Skip to content

Commit

Permalink
fix: bugs and update
Browse files Browse the repository at this point in the history
  • Loading branch information
jianchang512 committed May 8, 2024
1 parent c816720 commit b9afe21
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ edge-tts==6.1.11
elevenlabs==0.2.27
exceptiongroup==1.1.3
executing==2.0.1
faster-whisper==1.0.1
faster-whisper==1.0.2
ffmpeg-python==0.2.0
filelock==3.12.4
flatbuffers==1.12
Expand Down Expand Up @@ -76,7 +76,6 @@ llvmlite==0.42.0
Markdown==3.5
MarkupSafe==2.1.3
matplotlib-inline==0.1.6
mkl==2021.4.0
more-itertools==10.1.0
moviepy==1.0.3
mpmath==1.3.0
Expand Down Expand Up @@ -154,8 +153,8 @@ termcolor==2.3.0
threadpoolctl==3.2.0
tiktoken==0.6.0
tokenizers==0.15.2
torch==2.3.0
torchaudio==2.3.0
torch==2.2.0
torchaudio==2.2.0
tqdm==4.66.1
traitlets==5.14.1
typer==0.3.2
Expand Down
4 changes: 2 additions & 2 deletions videotrans/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

VERSION="v1.69"
VERSION_NUM=110690
VERSION="v1.70"
VERSION_NUM=110700
2 changes: 1 addition & 1 deletion videotrans/configure/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def parse_init():
# ffmpeg
if sys.platform == 'win32':
PWD=rootdir.replace('/','\\')
os.environ['PATH'] = PWD + f';{PWD}\\ffmpeg;{PWD}\\_internal\torch\lib;' + os.environ['PATH']
os.environ['PATH'] = PWD + f';{PWD}\\ffmpeg;' + os.environ['PATH']

else:
os.environ['PATH'] = rootdir + f':{rootdir}/ffmpeg:' + os.environ['PATH']
Expand Down
2 changes: 2 additions & 0 deletions videotrans/translator/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def trans(text_list, target_language="English", *, set_p=True,inst=None,stop=0,s

if err:
config.logger.error(f'[ChatGPT]翻译请求失败:{err=}')
if err.lower().find("Connection error")>-1:
err='连接失败 '+err
raise Exception(f'ChatGPT:{err}')

if not is_srt:
Expand Down
2 changes: 2 additions & 0 deletions videotrans/translator/freegoogle.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def trans(text_list, target_language="en", *, set_p=True,inst=None,stop=0,source

if err:
config.logger.error(f'[FreeGoogle]翻译请求失败:{err=}')
if err.lower().find("Connection error")>-1:
err='连接失败 '+err
raise Exception(f'FreeGoogle:{err}')
if isinstance(text_list, str):
return "\n".join(target_text)
Expand Down
2 changes: 2 additions & 0 deletions videotrans/translator/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ def trans(text_list, target_language="English", *, set_p=True, inst=None, stop=0

if err:
config.logger.error(f'[Gemini]翻译请求失败:{err=}')
if err.lower().find("Connection error")>-1:
err='连接失败 '+err
raise Exception(f'Gemini:{err}')

if not is_srt:
Expand Down
2 changes: 2 additions & 0 deletions videotrans/translator/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def trans(text_list, target_language="en", *, set_p=True,inst=None,stop=0,source

if err:
config.logger.error(f'[Google]翻译请求失败:{err=}')
if err.lower().find("Connection error")>-1:
err='连接失败 '+err
raise Exception(f'Google:{err}')


Expand Down

0 comments on commit b9afe21

Please sign in to comment.