Browse Source

增加等待时间

zhangyong 9 tháng trước cách đây
mục cha
commit
0e06142c5b
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      common/cover_gpt4o.py

+ 5 - 0
common/cover_gpt4o.py

@@ -1,3 +1,5 @@
+import time
+
 import requests
 import json
 
@@ -273,12 +275,15 @@ class CoverAnalyzer:
                 return data_dict
             except requests.exceptions.RequestException as e:
                 print(f"请求出错: {e}")
+                time.sleep(1)
                 continue
             except json.JSONDecodeError as e:
                 print(f"JSON 解析错误: {e}")
+                time.sleep(1)
                 continue
             except Exception as e:
                 print(f"其他错误: {e}")
+                time.sleep(1)
                 continue
 
         return None