|
@@ -356,31 +356,31 @@ def recall_videos(params, trace_id):
|
|
|
user_id = gh_id_dict[ghId]['uid']
|
|
|
|
|
|
# 在外面搜索视频
|
|
|
- payload = {
|
|
|
- "ghId": ghId,
|
|
|
- "search_keys": [title],
|
|
|
- "trace_id": trace_id
|
|
|
- }
|
|
|
- # print(payload)
|
|
|
- url = "http://0.0.0.0:8112/search_videos"
|
|
|
- requests.post(url, json=payload)
|
|
|
- # print("请求完成")
|
|
|
- time.sleep(15)
|
|
|
- select_sql = "select video_id, video_title from crawler_video where platform='weixin_search' and user_id = '{}' order by update_time DESC limit 10".format(
|
|
|
- user_id)
|
|
|
- out_video_list = select(sql=select_sql)
|
|
|
- dir_path = os.path.join(os.getcwd(), 'applications', 'static', "out_videos")
|
|
|
- os.makedirs(os.path.dirname(dir_path), exist_ok=True)
|
|
|
- done_list = os.listdir(dir_path)
|
|
|
- process_list = [
|
|
|
- (
|
|
|
- i[1],
|
|
|
- trace_id,
|
|
|
- os.path.join(dir_path, "{}.json".format(i[0]))
|
|
|
- ) for i in out_video_list if not "{}.json".format(i[0]) in done_list
|
|
|
- ]
|
|
|
- with ThreadPoolExecutor(max_workers=10) as pool:
|
|
|
- pool.map(ask_kimi_and_save_to_local, process_list)
|
|
|
+ # payload = {
|
|
|
+ # "ghId": ghId,
|
|
|
+ # "search_keys": [title],
|
|
|
+ # "trace_id": trace_id
|
|
|
+ # }
|
|
|
+ # # print(payload)
|
|
|
+ # url = "http://61.48.133.26:8111/search_videos"
|
|
|
+ # requests.post(url, json=payload)
|
|
|
+ # # print("请求完成")
|
|
|
+ # time.sleep(15)
|
|
|
+ # select_sql = "select video_id, video_title from crawler_video where platform='weixin_search' and user_id = '{}' order by update_time DESC limit 10".format(
|
|
|
+ # user_id)
|
|
|
+ # out_video_list = select(sql=select_sql)
|
|
|
+ # dir_path = os.path.join(os.getcwd(), 'applications', 'static', "out_videos")
|
|
|
+ # os.makedirs(os.path.dirname(dir_path), exist_ok=True)
|
|
|
+ # done_list = os.listdir(dir_path)
|
|
|
+ # process_list = [
|
|
|
+ # (
|
|
|
+ # i[1],
|
|
|
+ # trace_id,
|
|
|
+ # os.path.join(dir_path, "{}.json".format(i[0]))
|
|
|
+ # ) for i in out_video_list if not "{}.json".format(i[0]) in done_list
|
|
|
+ # ]
|
|
|
+ # with ThreadPoolExecutor(max_workers=10) as pool:
|
|
|
+ # pool.map(ask_kimi_and_save_to_local, process_list)
|
|
|
|
|
|
# 在两边召回视频
|
|
|
# pq_videos
|