wangkun 2 years ago
parent
commit
d947cacb30
1 changed files with 5 additions and 1 deletions
  1. 5 1
      kuaishou/kuaishou_author/kuaishou_author.py

+ 5 - 1
kuaishou/kuaishou_author/kuaishou_author.py

@@ -169,6 +169,9 @@ class KuaishouauthorScheduling:
                     for k, v in video_dict.items():
                         Common.logger(log_type, crawler).info(f"{k}:{v}")
 
+                    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((int(time.time()) - int(publish_time_stamp)) / (3600*24))}天\n')
+                        return
                     if video_dict["video_id"] == '' or video_dict["cover_url"] == '' or video_dict["video_url"] == '':
                         Common.logger(log_type, crawler).info('无效视频\n')
                     elif download_rule(log_type=log_type, crawler=crawler, video_dict=video_dict, rule_dict=rule_dict) is False:
@@ -326,5 +329,6 @@ class KuaishouauthorScheduling:
 
 
 if __name__ == "__main__":
-    KuaishouauthorScheduling.get_cookie("author", "kuaishou", "dev")
+    # KuaishouauthorScheduling.get_cookie("author", "kuaishou", "dev")
+    print(int((int(time.time())-1681340400)/(3600*24)))
     pass