wangkun 2 years ago
parent
commit
058e1c9946
7 changed files with 54 additions and 27 deletions
  1. 4 0
      README.MD
  2. 0 3
      logs/__init__.py
  3. 3 2
      main/demo.py
  4. 4 0
      main/haokan_hot.py
  5. 13 19
      main/haokan_play.py
  6. 6 3
      main/run_haokan_hot.py
  7. 24 0
      main/run_haokan_play.py

+ 4 - 0
README.MD

@@ -17,6 +17,10 @@
 2. python3 ./main/run_xx.py
 
 #### 需求
+2022/11/26 频道播放量榜
+1. 新增:首页频道
+2. 新增:音乐频道
+
 2022/11/24 今日热播榜
 1. 运行时间: 每日13:00
 2. 热门列表 50 条,全抓

+ 0 - 3
logs/__init__.py

@@ -1,3 +0,0 @@
-# -*- coding: utf-8 -*-
-# @Author: wangkun
-# @Time: 2022/11/23

+ 3 - 2
main/demo.py

@@ -22,5 +22,6 @@ class Demo:
 
 
 if __name__ == '__main__':
-    # Demo.get_sheet('demo', 'haokan', 'TaQXk3')
-    Demo.publish_time()
+    Demo.get_sheet('demo', 'haokan', '7f05d8')
+    # Demo.publish_time()
+    pass

+ 4 - 0
main/haokan_hot.py

@@ -129,6 +129,10 @@ class Hot:
             Common.logger(log_type).info('无效视频\n')
         elif video_dict['video_id'] in [x for y in Feishu.get_values_batch(log_type, 'haokan', '5pWipX') for x in y]:
             Common.logger(log_type).info('视频已下载\n')
+        elif video_dict['video_id'] in [x for y in Feishu.get_values_batch(log_type, 'haokan', '7f05d8') for x in y]:
+            Common.logger(log_type).info('视频已下载\n')
+        elif video_dict['video_id'] in [x for y in Feishu.get_values_batch(log_type, 'haokan', 'A5VCbq') for x in y]:
+            Common.logger(log_type).info('视频已下载\n')
         else:
             # 下载
             Common.download_method(log_type, 'cover', video_dict['video_title'], video_dict['cover_url'])

File diff suppressed because it is too large
+ 13 - 19
main/haokan_play.py


+ 6 - 3
main/run_haokan_hot.py

@@ -14,11 +14,14 @@ class Main:
     @classmethod
     def main(cls, log_type, our_id, env):
         while True:
-            if datetime.datetime.now().now().hour >= 13:
+            if datetime.datetime.now().now().hour >= 0:
                 Hot.get_hot_feeds(log_type, our_id, env)
                 Common.del_logs(log_type)
-                Common.logger(log_type).info(f'进入热榜抓取完毕,休眠{24-datetime.datetime.now().hour}小时')
-                time.sleep(3600*(24-datetime.datetime.now().hour))
+                # Common.logger(log_type).info(f'热榜抓取完毕,休眠{24-datetime.datetime.now().hour}小时')
+                # time.sleep(3600 * (24 - datetime.datetime.now().hour))
+                Hot.page = 0
+                Common.logger(log_type).info('热榜抓取完毕,休眠1小时')
+                time.sleep(3600)
             else:
                 pass
 

+ 24 - 0
main/run_haokan_play.py

@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# @Author: wangkun
+# @Time: 2022/11/26
+import os
+import random
+import sys
+import time
+sys.path.append(os.getcwd())
+from main.common import Common
+from main.haokan_play import Play
+
+
+class Main:
+    @classmethod
+    def main(cls, log_type, env):
+        while True:
+            Play.get_tab_videos(log_type, env)
+            Common.del_logs(log_type)
+            Common.logger(log_type).info('随机休眠 10 - 30 秒\n')
+            time.sleep(random.randint(10, 30))
+
+
+if __name__ == '__main__':
+    Main.main('play', 'prod')

Some files were not shown because too many files changed in this diff