zhangyong 7 месяцев назад
Родитель
Сommit
0e06142c5b
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      common/cover_gpt4o.py

+ 5 - 0
common/cover_gpt4o.py

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