wangkun 2 years ago
parent
commit
fadf75332d
2 changed files with 3 additions and 6 deletions
  1. 3 5
      main/jxxf_recommend.py
  2. 0 1
      main/run_jxxf_recommend.py

+ 3 - 5
main/jxxf_recommend.py

@@ -31,8 +31,6 @@ class Recommend:
             return
         width = int(video_stream['width'])
         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'])
         return width, height, duration
 
@@ -252,7 +250,7 @@ class Recommend:
                             # 保存视频信息至 "./videos/{download_video_title}/info.txt"
                             with open("./videos/" + video_title
                                       + "/" + "info.txt", "a", encoding="UTF-8") as f_a:
-                                f_a.write(str(int(time.time())) + "\n" +
+                                f_a.write("jixiangxingfu" + str(int(time.time())) + "\n" +
                                           str(video_title) + "\n" +
                                           str(int(download_duration)) + "\n" +
                                           str(int(float(
@@ -317,8 +315,8 @@ class Recommend:
                     cls.i = 0
                     break
 
-        except Exception:
-            Common.logger(log_type).error('get_recommend异常,重启APP\n')
+        except Exception as e:
+            Common.logger(log_type).error('get_recommend异常,重启APP:{}\n', e)
             cls.quit(log_type, driver)
             cls.i = 0
             cls.start_wechat(log_type, env)

+ 0 - 1
main/run_jxxf_recommend.py

@@ -13,7 +13,6 @@ class Main:
     @classmethod
     def main(cls, log_type, env):
         while True:
-            # if datetime.datetime.now().hour <= 8:
             if 23 >= datetime.datetime.now().hour >= 17:
                 Common.logger(log_type).info('开始抓取"祝福大家好才是真好"\n')
                 Recommend.start_wechat(log_type, env)