wangkun 1 年間 前
コミット
cd335caaef
2 ファイル変更4 行追加2 行削除
  1. 1 1
      README.md
  2. 3 1
      main/kanyikan_recommend.py

+ 1 - 1
README.md

@@ -15,7 +15,7 @@ sh kanyikan.sh --log_type="recommend" --crawler="kanyikan" --env="dev"
 正式环境:
 * * * * * /bin/sh /Users/lieyunye/Desktop/crawler/crawler_kanyikan/kanyikan.sh --log_type="recommend" --crawler="kanyikan" --env="prod"
 杀进程
-ps aux | grep run_kanyikan_recommend | grep -v grep | awk '{print $2}' | xargs kill -9
+ps aux | grep kanyikan_recommend | grep -v grep | awk '{print $2}' | xargs kill -9
 
 videoid.txt 存储视频信息:
    - 视频 ID

+ 3 - 1
main/kanyikan_recommend.py

@@ -37,9 +37,11 @@ class Kanyikanrecommend:
 
     @classmethod
     def download_rule(cls, video_dict):
+        now = int(time.time())
+        publish_day = int(int(now - video_dict["publish_time_stamp"]) / (3600*24))
         if (int(video_dict["video_width"]) or int(video_dict["video_height"]) >= 720) \
             and int(video_dict["duration"]) >= 40\
-            and ((int(int(int(time.time()) - video_dict["publish_time_stamp"]) / (3600*24)) >= 7 and int(video_dict["play_cnt"]) >= 500) or ((int(int(int(time.time()) - video_dict["publish_time_stamp"]) / (3600*24)) < 7 and int(video_dict["play_cnt"]) >= 100) or (int(video_dict["publish_time_stamp"]) >= int(time.mktime(time.strptime("2021-06-01 00:00:00", "%Y-%m-%d %H:%M:%S")))))):
+            and ((publish_day >= 7 and int(video_dict["play_cnt"]) >= 500) or (publish_day < 7 and int(video_dict["play_cnt"]) >= 100)):
             return True
         else:
             return False