wangkun 2 anos atrás
pai
commit
94fc6b60d6
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      main/recommend_list.py

+ 4 - 1
main/recommend_list.py

@@ -2,6 +2,7 @@
 # @Author: wangkun
 # @Time: 2022/7/12
 import os
+import random
 import shutil
 import sys
 import time
@@ -104,7 +105,7 @@ class Recommend:
     @classmethod
     def get_video_list(cls, log_type):
         try:
-            # 翻
+            # 翻50
             for num in range(1, 51):
                 Common.logger(log_type).info("正在抓取第{}页\n", num)
                 url = "https://pro.yaoman.net/api/work/list/%E6%8E%A8%E8%8D%90/" + str(num)
@@ -452,12 +453,14 @@ class Recommend:
     def run_download_publish(cls, log_type, env):
         try:
             while True:
+                time.sleep(1)
                 recommend_feeds_sheet = Feishu.get_values_batch(log_type, "music_album", "69UxPo")
                 if len(recommend_feeds_sheet) == 1:
                     Common.logger(log_type).info("下载/上传完成\n")
                     break
                 else:
                     cls.download_publish(log_type, env)
+                    time.sleep(random.randint(1, 3))
         except Exception as e:
             Common.logger(log_type).error("run_download_publish异常:{}", e)