| 1234567891011121314151617181920212223242526272829 |
- import json
- from client.AIGCClient import AIGCClient
- aigc_client = AIGCClient(token="8bf14f27fc3a486788f3383452422d72", base_url="https://aigc-api.aiddit.com")
- log_list = []
- with open("/Users/zhao/Downloads/cb08b033-8ab9-48e9-baf2-1ec5b031e0e5.json", 'r') as f:
- line = f.readline()
- while line:
- log_list.append(json.loads(line))
- line = f.readline()
- for log in log_list:
- crawler_plan_id = log.get("crawlerPlanId")
- video_id = log.get("videoId")
- if crawler_plan_id == '20260122023138114334284':
- continue
- error_msg, crawler_plan_info = aigc_client.get_content_crawler_plan_by_id(crawler_plan_id)
- if error_msg:
- print(f"获取 {crawler_plan_id} 的爬取信息异常")
- continue
- update_use_date = crawler_plan_info.get("updateData")
- crawler_plan_name = update_use_date['name']
- if "视频vid" not in crawler_plan_name:
- continue
- new_crawler_plan_name = crawler_plan_name.replace("{视频vid}", video_id)
- update_use_date['name'] = new_crawler_plan_name
- # aigc_client.crawler_plan_save(update_use_date)
|