zhangyong 8 months ago
parent
commit
14c06d39eb
2 changed files with 4 additions and 1 deletions
  1. 2 1
      data_channel/dy_ls.py
  2. 2 0
      video_rewriting/video_processor.py

+ 2 - 1
data_channel/dy_ls.py

@@ -14,6 +14,7 @@ class DYLS:
     def get_dyls_list(cls, task_mark, url_id, number, mark):
     def get_dyls_list(cls, task_mark, url_id, number, mark):
         next_cursor = ""
         next_cursor = ""
         for i in range(50):
         for i in range(50):
+            list = []
             try:
             try:
                 #  抖查查
                 #  抖查查
                 url = "http://8.217.190.241:8888/crawler/dou_yin/blogger"
                 url = "http://8.217.190.241:8888/crawler/dou_yin/blogger"
@@ -28,7 +29,7 @@ class DYLS:
                 time.sleep(random.randint(1, 5))
                 time.sleep(random.randint(1, 5))
                 response = requests.request("POST", url, headers=headers, data=payload)
                 response = requests.request("POST", url, headers=headers, data=payload)
                 response = response.json()
                 response = response.json()
-                list = []
+
                 data_all_list = response["data"]
                 data_all_list = response["data"]
                 has_more = data_all_list["has_more"]
                 has_more = data_all_list["has_more"]
                 next_cursor = str(data_all_list["next_cursor"])
                 next_cursor = str(data_all_list["next_cursor"])

+ 2 - 0
video_rewriting/video_processor.py

@@ -271,6 +271,8 @@ class VideoProcessor:
                 if len(new_title_re) > 12:
                 if len(new_title_re) > 12:
                     new_text = '\n'.join(
                     new_text = '\n'.join(
                         [new_title_re[i:i + 12] for i in range(0, len(new_title_re), 12)])
                         [new_title_re[i:i + 12] for i in range(0, len(new_title_re), 12)])
+                else:
+                    new_text = new_title_re
                 new_video_path = FFmpeg.add_video_zm(new_video_path, video_path_url, pw_random_id, new_text)
                 new_video_path = FFmpeg.add_video_zm(new_video_path, video_path_url, pw_random_id, new_text)
             return new_video_path
             return new_video_path
         else:
         else: