wangkun 2 anos atrás
pai
commit
55c60309e6
3 arquivos alterados com 4 adições e 18 exclusões
  1. 3 2
      README.md
  2. 1 2
      main/run_zqttk_recommend.py
  3. 0 14
      main/zqttk_recommend.py

+ 3 - 2
README.md

@@ -17,16 +17,17 @@
 
 
 
 
 #### 使用说明
 #### 使用说明
-
 1. cd ./crawler_zhiqingzongqun
 1. cd ./crawler_zhiqingzongqun
 2. python3 ./main/run_xx.py
 2. python3 ./main/run_xx.py
 
 
 
 
 #### 需求
 #### 需求
+2022/11/08
+1. 运行时间: 9:00 - 12:00
 
 
 2022/10/19
 2022/10/19
 1. 抓取小程序更换: 知青天天看
 1. 抓取小程序更换: 知青天天看
-2. 抓取时间: 17:00 - 8:00
+2. 抓取时间: 00:00 - 8:00
 
 
 2022/10/14
 2022/10/14
 1. 运行时间: 17:00:00 - 24:00:00
 1. 运行时间: 17:00:00 - 24:00:00

+ 1 - 2
main/run_zqttk_recommend.py

@@ -13,8 +13,7 @@ class Main:
     @classmethod
     @classmethod
     def main(cls, log_type, env):
     def main(cls, log_type, env):
         while True:
         while True:
-            # if 23 >= datetime.datetime.now().hour >= 17 or datetime.datetime.now().hour <= 8:
-            if datetime.datetime.now().hour <= 8:
+            if 12 >= datetime.datetime.now().hour >= 9:
                 Common.logger(log_type).info('开始抓取知青天天看\n')
                 Common.logger(log_type).info('开始抓取知青天天看\n')
                 Recommend.start_wechat(log_type, env)
                 Recommend.start_wechat(log_type, env)
                 Recommend.i = 0
                 Recommend.i = 0

+ 0 - 14
main/zqttk_recommend.py

@@ -23,27 +23,13 @@ class Recommend:
     @classmethod
     @classmethod
     def get_video_info_from_local(cls, video_path):
     def get_video_info_from_local(cls, video_path):
         probe = ffmpeg.probe(video_path)
         probe = ffmpeg.probe(video_path)
-        # print('video_path: {}'.format(video_path))
-        # format1 = probe['format']
-        # bit_rate = int(format1['bit_rate']) / 1000
-        # duration = format['duration']
-        # size = int(format1['size']) / 1024 / 1024
         video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None)
         video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None)
         if video_stream is None:
         if video_stream is None:
             print('No video stream found!')
             print('No video stream found!')
             return
             return
         width = int(video_stream['width'])
         width = int(video_stream['width'])
         height = int(video_stream['height'])
         height = int(video_stream['height'])
-        # num_frames = int(video_stream['nb_frames'])
-        # fps = int(video_stream['r_frame_rate'].split('/')[0]) / int(video_stream['r_frame_rate'].split('/')[1])
         duration = float(video_stream['duration'])
         duration = float(video_stream['duration'])
-        # print('width: {}'.format(width))
-        # print('height: {}'.format(height))
-        # print('num_frames: {}'.format(num_frames))
-        # print('bit_rate: {}k'.format(bit_rate))
-        # print('fps: {}'.format(fps))
-        # print('size: {}MB'.format(size))
-        # print('duration: {}'.format(duration))
         return width, height, duration
         return width, height, duration
 
 
     @classmethod
     @classmethod