zhangyong vor 9 Monaten
Ursprung
Commit
0a2d994b31
3 geänderte Dateien mit 6 neuen und 10 gelöschten Zeilen
  1. 2 0
      common/gpt4o_help.py
  2. 1 10
      common/tts_help.py
  3. 3 0
      video_rewriting/video_prep.py

+ 2 - 0
common/gpt4o_help.py

@@ -151,6 +151,8 @@ class GPT4o():
                     pw = match.group(1)
                     return pw
                 else:
+                    if content:
+                        return content
                     if attempt == max_retries - 1:
                         return None
             except Exception:

+ 1 - 10
common/tts_help.py

@@ -24,21 +24,12 @@ class TTS:
             })
             headers = {
                 'accept': 'application/json, text/plain, */*',
-                'accept-language': 'zh-CN',
-                'cache-control': 'no-cache',
                 'content-type': 'application/json',
                 'cookie': 'anylangIsLogin=true',
                 'origin': 'https://app.guiji.cn',
                 'pragma': 'no-cache',
-                'priority': 'u=1, i',
                 'referer': 'https://app.guiji.cn/',
-                'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"',
-                'sec-ch-ua-mobile': '?0',
-                'sec-ch-ua-platform': '"macOS"',
-                'sec-fetch-dest': 'empty',
-                'sec-fetch-mode': 'cors',
-                'sec-fetch-site': 'same-site',
-                'token': '72912b4ac30b412cb19d2e835a678854'
+                'token': 'f16e8bfcae6049d6b68b21f945bd00ad'
             }
             wait_time = random.uniform(5, 20)
             time.sleep(wait_time)

+ 3 - 0
video_rewriting/video_prep.py

@@ -199,8 +199,11 @@ class getVideo:
                                         pw_srt = TTS.getSrt(pw_url)
                                         Common.logger("log").info(f"{task_mark}下的视频{url},获取AI片尾srt成功")
                                     else:
+                                        Feishu.bot(mark, 'TTS获取失败提示', f'无法获取到片尾音频,及时更换token', "张勇")
+                                        Common.logger("log").info(f"{task_mark}下的视频{url},获取AI片尾失败")
                                         continue
                                 else:
+                                    Common.logger("log").info(f"{task_mark}下的视频{url},获取AI片尾失败")
                                     continue
                             else:
                                 if ',' in video_ending: