wangkun 2 năm trước cách đây
mục cha
commit
edcef0fb4b
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      kuaishou/kuaishou_follow/kuaishou_follow.py

+ 3 - 3
kuaishou/kuaishou_follow/kuaishou_follow.py

@@ -540,8 +540,8 @@ class Follow:
             Common.logger(log_type, crawler).error(f"get_videoList:{e}\n")
 
     @classmethod
-    def repeat_video(cls, log_type, crawler, video_id, env, machine):
-        sql = f""" select * from crawler_video where platform="{cls.platform}" and out_video_id="{video_id}"; """
+    def repeat_video(cls, log_type, crawler, video_id, video_title, publish_time, env, machine):
+        sql = f""" select * from crawler_video where platform="{cls.platform}" and out_video_id="{video_id}" or (platform="{cls.platform}" and video_title="{video_title}" and publish_time="{publish_time}") """
         repeat_video = MysqlHelper.get_values(log_type, crawler, sql, env, machine)
         return len(repeat_video)
 
@@ -549,7 +549,7 @@ class Follow:
     def download_publish(cls, log_type, crawler, strategy, video_dict, rule_dict, our_uid, oss_endpoint, env, machine):
         try:
             download_finished = False
-            if cls.repeat_video(log_type, crawler, video_dict['video_id'], env, machine) != 0:
+            if cls.repeat_video(log_type, crawler, video_dict['video_id'], video_dict['video_title'], video_dict['publish_time_str'], env, machine) != 0:
                 Common.logger(log_type, crawler).info('视频已下载\n')
             elif video_dict['video_id'] in [x for y in Feishu.get_values_batch(log_type, crawler, "3cd128") for x in y]:
                 Common.logger(log_type, crawler).info('视频已下载\n')