浏览代码

下载视频时,增加去重逻辑

wangkun 3 年之前
父节点
当前提交
2228a68aea
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      main/hour_list.py

+ 4 - 0
main/hour_list.py

@@ -787,6 +787,10 @@ class HourList:
                         # 过滤带字母的视频ID
                         # 过滤带字母的视频ID
                         elif any(word if word in v_id else False for word in cls.sensitive_videoid_words()) is True:
                         elif any(word if word in v_id else False for word in cls.sensitive_videoid_words()) is True:
                             Common.logger().info("视频ID带字母:{}".format(v_id))
                             Common.logger().info("视频ID带字母:{}".format(v_id))
+                            # 从云文档中去重:https://w42nne6hzg.feishu.cn/sheets/shtcnYxiyQ1wLklo1W5Kdqc9cGh?sheet=yatRv2
+                        elif v_id in [j for i in Feishu.get_values_batch("logs", "xiaoniangao", "yatRv2") for j in i]:
+                            Common.logger().info("该视频已下载:{}", v_title)
+                            time.sleep(1)
                         # 上升榜判断逻辑,任意时间段上升量>=5000,连续两个时间段上升量>=2000
                         # 上升榜判断逻辑,任意时间段上升量>=5000,连续两个时间段上升量>=2000
                         elif int(ten_cnt) >= 5000 or int(fifteen_cnt) >= 5000 or int(twenty_cnt) >= 5000:
                         elif int(ten_cnt) >= 5000 or int(fifteen_cnt) >= 5000 or int(twenty_cnt) >= 5000:
                             Common.logger().info("10:00 or 15:00 or 20:00 数据上升量:{} or {} or {} >= 5000",
                             Common.logger().info("10:00 or 15:00 or 20:00 数据上升量:{} or {} or {} >= 5000",