|
@@ -61,17 +61,19 @@ async def update_crawler_table_with_exist_content_id(root_content_id, content_id
|
|
|
用root_content_id 查询出已经下载过的视频信息,用new_content_id更新
|
|
|
"""
|
|
|
select_sql = f"""
|
|
|
- SELECT *
|
|
|
+ SELECT out_video_id, platform, video_title, play_count, like_count, share_count, publish_time, crawler_time,
|
|
|
+ duration, video_url, cover_url, download_status, video_oss_path, cover_oss_path, user_id, score, is_illegal
|
|
|
FROM {article_crawler_video_table}
|
|
|
WHERE content_id = '{root_content_id}'
|
|
|
AND download_status = {new_content_id_task_const.VIDEO_DOWNLOAD_SUCCESS_STATUS}
|
|
|
AND is_illegal = {new_content_id_task_const.VIDEO_SAFE};
|
|
|
"""
|
|
|
res_tuple = await db_client.async_select(select_sql)
|
|
|
- insert_list = [(content_id,) + row[2:-3] + (trace_id,) + row[-2:] for row in res_tuple]
|
|
|
+ insert_list = [(trace_id, content_id) + row for row in res_tuple]
|
|
|
insert_sql = f"""
|
|
|
INSERT INTO {article_crawler_video_table}
|
|
|
- (content_id, out_video_id, platform, video_title, play_count, like_count, share_count, publish_time, crawler_time, duration, video_url, cover_url, download_status, video_oss_path, cover_oss_path, user_id, trace_id, score, is_illegal)
|
|
|
+ (trace_id, content_id, out_video_id, platform, video_title, play_count, like_count, share_count, publish_time, crawler_time,
|
|
|
+ duration, video_url, cover_url, download_status, video_oss_path, cover_oss_path, user_id, score, is_illegal)
|
|
|
VALUES
|
|
|
(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
|
|
|
"""
|