Kaynağa Gözat

下载之前,再次去重

wangkun 3 yıl önce
ebeveyn
işleme
39637f2138
3 değiştirilmiş dosya ile 7 ekleme ve 4 silme
  1. 3 2
      main/download_play.py
  2. 2 1
      main/download_sendtime.py
  3. 2 1
      main/download_up.py

+ 3 - 2
main/download_play.py

@@ -67,8 +67,9 @@ class DownloadPlay:
                         download_video_url = Feishu.get_values_batch("SdCHOM")[i+1][13]
                         download_video_session = Feishu.get_values_batch("SdCHOM")[i+1][14]
 
-                        if cls.play_rule(download_video_width, download_video_height,
-                                         download_video_duration, download_video_play_cnt) is True:
+                        if download_video_id not in [j for i in Feishu.get_values_batch("20ce0c") for j in i]\
+                                and cls.play_rule(download_video_width, download_video_height,
+                                                  download_video_duration, download_video_play_cnt) is True:
                             Common.logger().info("开始下载视频:{}", download_video_title)
 
                             # 下载封面

+ 2 - 1
main/download_sendtime.py

@@ -108,7 +108,8 @@ class DownloadSendtime:
                                     download_url_up = data["play_info"]["items"][0]["play_url"]
 
                             # 判断基本规则
-                            if cls.send_time_rule(v_width, v_height, v_duration, v_play_cnt_sendtime) is True \
+                            if download_video_id not in [j for i in Feishu.get_values_batch("20ce0c") for j in i]\
+                                    and cls.send_time_rule(v_width, v_height, v_duration, v_play_cnt_sendtime) is True \
                                     and download_video_id != "" and download_video_title != "" and v_duration != "" \
                                     and v_play_cnt_sendtime != "" and v_comment_cnt != "" and v_liked_cnt != "" \
                                     and v_shared_cnt != "" and v_width != "" and v_height != "" \

+ 2 - 1
main/download_up.py

@@ -116,7 +116,8 @@ class DownloadUp:
                                     download_url_up = data["play_info"]["items"][0]["play_url"]
 
                             # 判断基本规则
-                            if cls.up_rule(v_width, v_height, v_duration, v_play_cnt_up) is True \
+                            if download_video_id not in [j for i in Feishu.get_values_batch("20ce0c") for j in i]\
+                                    and cls.up_rule(v_width, v_height, v_duration, v_play_cnt_up) is True \
                                     and download_video_id != "" and download_video_title != "" and v_duration != "" \
                                     and v_play_cnt_up != "" and v_comment_cnt != "" and v_liked_cnt != "" \
                                     and v_shared_cnt != "" and v_width != "" and v_height != "" \