Przeglądaj źródła

抖音置顶视频校验

zhangyong 1 rok temu
rodzic
commit
ce53b723ef
1 zmienionych plików z 13 dodań i 10 usunięć
  1. 13 10
      douyin/douyin_author/douyin_author_scheduling_new.py

+ 13 - 10
douyin/douyin_author/douyin_author_scheduling_new.py

@@ -154,6 +154,8 @@ class DouyinauthorScheduling:
                             env=env,
                             message='扫描到一条视频\n'
                         )
+                        is_top = data[i].get('is_top')  # 是否置顶
+
                         video_id = data[i].get('aweme_id')  # 文章id
                         video_title = data[i].get('desc', "").strip().replace("\n", "") \
                             .replace("/", "").replace("\\", "").replace("\r", "") \
@@ -211,16 +213,17 @@ class DouyinauthorScheduling:
                             env=env,
                             message=f"{video_dict}\n"
                         )
-                        if int((int(time.time()) - int(publish_time_stamp)) / (3600*24)) > int(rule_dict.get("period", {}).get("max", 1000)):
-                            Common.logger(log_type, crawler).info(f'发布时间超过{int(rule_dict.get("period", {}).get("max", 1000))}天\n')
-                            AliyunLogger.logging(
-                                code="2004",
-                                platform=crawler,
-                                mode=log_type,
-                                env=env,
-                                message=f'发布时间超过{int(rule_dict.get("period", {}).get("max", 1000))}天\n'
-                            )
-                            return
+                        if is_top == 0:
+                            if int((int(time.time()) - int(publish_time_stamp)) / (3600*24)) > int(rule_dict.get("period", {}).get("max", 1000)):
+                                Common.logger(log_type, crawler).info(f'发布时间超过{int(rule_dict.get("period", {}).get("max", 1000))}天\n')
+                                AliyunLogger.logging(
+                                    code="2004",
+                                    platform=crawler,
+                                    mode=log_type,
+                                    env=env,
+                                    message=f'发布时间超过{int(rule_dict.get("period", {}).get("max", 1000))}天\n'
+                                )
+                                return
                         if video_dict["video_id"] == '' or video_dict["cover_url"] == '' or video_dict["video_url"] == '':
                             Common.logger(log_type, crawler).info('无效视频\n')
                             AliyunLogger.logging(