wangkun 2 years ago
parent
commit
6034657ace
2 changed files with 12 additions and 9 deletions
  1. 4 1
      README.md
  2. 8 8
      main/run_zhihu_hot.py

+ 4 - 1
README.md

@@ -24,11 +24,14 @@
 1. 热榜:
    - 发布时间<180天
    - 视频播放量>3w
+   - 运行时间: 
+     - 每页抓取完,休眠 1 分钟;
+     - 24 小时持续运行。
 2. 定向榜:
    - 发布时间<30天
    - 视频时长1分钟以上
    - 运行时间:
-     - 每个用户主页抓取,休眠 1 分钟;
+     - 每个用户主页抓取,休眠 1 分钟;
      - 所有用户主页抓取完,休眠 1 小时;
      - 24 小时持续运行。
 3. 增加报警

+ 8 - 8
main/run_zhihu_hot.py

@@ -15,14 +15,14 @@ class Main:
     @classmethod
     def main(cls, log_type, env):
         while True:
-            if 22 >= datetime.datetime.now().hour >= 8:
-                Common.logger(log_type).info('开始抓取知乎热榜\n')
-                ZhihuHot.get_hot_feeds(log_type, env)
-                Common.del_logs(log_type)
-                Common.logger(log_type).info('随机休眠 60-180 秒\n')
-                time.sleep(random.randint(60, 60*3))
-            else:
-                pass
+            # if 22 >= datetime.datetime.now().hour >= 8:
+            Common.logger(log_type).info('开始抓取知乎热榜\n')
+            ZhihuHot.get_hot_feeds(log_type, env)
+            Common.del_logs(log_type)
+            Common.logger(log_type).info('随机休眠 60-180 秒\n')
+            time.sleep(random.randint(60, 60*3))
+            # else:
+            #     pass
 
 
 if __name__ == '__main__':