zhangyong 4 месяцев назад
Родитель
Сommit
ef7a83687d
3 измененных файлов с 7 добавлено и 3 удалено
  1. 3 1
      data_channel/dy_keyword.py
  2. 3 1
      data_channel/dy_ls.py
  3. 1 1
      video_rewriting/video_processor.py

+ 3 - 1
data_channel/dy_keyword.py

@@ -58,7 +58,9 @@ class DyKeyword:
                 status = sqlCollect.is_used(task_mark, video_id, mark, channel_id)
                 video_uri = data[i].get('video', {}).get('play_addr', {}).get('uri')
                 ratio = f'{data[i].get("video", {}).get("height")}p'
-                video_url = f'https://www.iesdouyin.com/aweme/v1/play/?video_id={video_uri}&ratio={ratio}&line=0'  # 视频链接
+                # video_url = f'https://www.iesdouyin.com/aweme/v1/play/?video_id={video_uri}&ratio={ratio}&line=0'  # 视频链接
+                video_url = data[i].get('video', {}).get('play_addr', {}).get('url_list', [None])[0]
+
                 old_title = data[i].get('desc', "").strip().replace("\n", "") \
                     .replace("/", "").replace("\\", "").replace("\r", "") \
                     .replace(":", "").replace("*", "").replace("?", "") \

+ 3 - 1
data_channel/dy_ls.py

@@ -44,7 +44,9 @@ class DYLS:
 
                     video_uri = data[i].get('video', {}).get('play_addr', {}).get('uri')
                     ratio = f'{data[i].get("video", {}).get("height")}p'
-                    video_url = f'https://www.iesdouyin.com/aweme/v1/play/?video_id={video_uri}&ratio={ratio}&line=0'  # 视频链接
+                    # video_url = f'https://www.iesdouyin.com/aweme/v1/play/?video_id={video_uri}&ratio={ratio}&line=0'
+                    video_url = data[i].get('video', {}).get('play_addr', {}).get('url_list', [None])[0]
+                    # 视频链接
                     digg_count = int(data[i].get('statistics').get('digg_count'))  # 点赞
                     share_count = int(data[i].get('statistics').get('share_count'))  # 转发
                     duration = data[i].get('duration')

+ 1 - 1
video_rewriting/video_processor.py

@@ -516,7 +516,7 @@ class VideoProcessor:
             if new_video_path == None:
                 return None
             Common.logger(mark).info(f"{channel_id}视频下载成功: {new_video_path}")
-        elif channel_id == "抖音" or channel_id == "抖音历史":
+        elif channel_id == "抖音" or channel_id == "抖音历史" or channel_id == "抖音搜索":
             new_video_path = PQ.download_dy_video(video_url, video_path_url, v_id)
             if new_video_path == None:
                 return None