Commit f0360ce3 authored by Yaowentong's avatar Yaowentong

修复豆包关联视频

parent 1c46681e
......@@ -293,6 +293,7 @@ def doubao_mobile_process_original_data(data):
new_url_list.append(item)
url_list = new_url_list
spider_save_tos.process_and_save_files(file_path, search_keyword, url_list, think_content, response_content,
suggestions, rich_media_block)
return (file_path, search_keyword, url_list, think_content, response_content, suggestions)
......@@ -328,7 +329,7 @@ if __name__ == '__main__':
# file_path = 'geo/c7eb465e-f385-4aa2-89c4-a7cf11897f45/KIMI/1(1).txt'
data_list = bh_utils.query_data(
f"select * from geo_commit_task where taskId = '27721b42-3368-4526-b092-d3157aaa617a' and platform = 'DOUBA'")
f"select * from geo_commit_task where taskId = '798f148f-6896-4853-b589-d968cd2d150e' and platform = 'DOUBA'")
......
......@@ -64,10 +64,19 @@ def doubao_android_process_rich_media(url_list):
for item in url_list:
video_id = item.get('item_id', '')
cover = item.get('cover') or {}
origin_cover = cover.get('origin_cover') or {}
image_ori = origin_cover.get('image_ori') or {}
video_first_frame_image = (
item.get('video_first_frame_image')
or image_ori.get('url')
or ''
)
raw_data = {
"video_id": video_id,
"video_captions": item.get('video_captions', ''),
"video_first_frame_image": item.get('video_first_frame_image', '') or item.get('cover').get('origin_cover').get('image_ori').get('url') or '',
"video_first_frame_image": video_first_frame_image,
"main_site_url": item.get('main_site_url', '') or f'https://www.douyin.com/video/{video_id}',
"source_app_name": item.get('source_app_name', '') or '抖音'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment