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/1680aba3-fa5b-4d53-8386-22cb1c3c8472.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") input_mode_values = log.get('inputModeValues') 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 "{话题}" not in crawler_plan_name: continue new_crawler_plan_name = crawler_plan_name.replace("{话题}", input_mode_values) update_use_date['name'] = new_crawler_plan_name aigc_client.crawler_plan_save(update_use_date)