wangkun пре 2 година
родитељ
комит
124f915f02
2 измењених фајлова са 5 додато и 6 уклоњено
  1. 3 3
      main/haokan_channel.py
  2. 2 3
      main/run_haokan_channel.py

+ 3 - 3
main/haokan_channel.py

@@ -80,7 +80,7 @@ class Channel:
                 feeds = r.json()['data']['response']['videos']
                 return feeds
         except Exception as e:
-            Common.logger(log_type).error(f'get_play_feeds异常:{e}\n')
+            Common.logger(log_type).error(f'get_channel_feeds异常:{e}\n')
 
     @classmethod
     def get_video_url(cls, log_type, video_id):
@@ -202,7 +202,7 @@ class Channel:
                               'video_url': video_url}
                 cls.download_publish(log_type, tab, our_id, video_dict, env)
         except Exception as e:
-            Common.logger(log_type).error(f'get_play_videos异常:{e}\n')
+            Common.logger(log_type).error(f'get_channel_videos异常:{e}\n')
 
     @classmethod
     def download_publish(cls, log_type, tab, our_id, video_dict, env):
@@ -297,7 +297,7 @@ class Channel:
                     cls.get_channel_videos(log_type, v.split(',')[0], v.split(',')[1], env)
                     time.sleep(10)
         except Exception as e:
-            Common.logger(log_type).error(f'get_tab_videos异常:{e}\n')
+            Common.logger(log_type).error(f'get_all_channel_videos异常:{e}\n')
 
 
 if __name__ == '__main__':

+ 2 - 3
main/run_haokan_channel.py

@@ -2,7 +2,6 @@
 # @Author: wangkun
 # @Time: 2022/11/26
 import os
-import random
 import sys
 import time
 sys.path.append(os.getcwd())
@@ -16,8 +15,8 @@ class Main:
         while True:
             Channel.get_all_channel_videos(log_type, env)
             Common.del_logs(log_type)
-            Common.logger(log_type).info('随机休眠 10 - 30 秒\n')
-            time.sleep(random.randint(10, 30))
+            Common.logger(log_type).info('休眠 1 小时\n')
+            time.sleep(3600)
 
 
 if __name__ == '__main__':