Open orophix opened 3 years ago
It seems to be this https://github.com/ssut/py-googletrans/issues/234 caused by py-googletrans. Perhaps replacing the dependency to https://github.com/Saravananslb/py-googletranslation may solve this issue.
Currently if you don't have too many subtitles files to do a bulk translation, you can use the following command to do a manual-copy-and-paste translation. (Not listed in the readme)
autosub -i {file} -tapi man -of dst -doc -mts 9820 -tf txt -F ass
This will generate a txt file which contain a certain amount of words to be translated. Then you copy them to any of the translation website such as https://www.deepl.com/translator. After that you copy all the translation results from the website and then overwrite all the content in the previous txt. Then input enter in autosub and do these again until all the content being translated and the translated subtitles will be generated.
Is there an easy way to make it use py-google translation instead?
I tried these arguments and it works.
autosub -SRC en -D zh -surl translate.google.com -slp 0.1
It seems to be this ssut/py-googletrans#234 caused by py-googletrans. Perhaps replacing the dependency to https://github.com/Saravananslb/py-googletranslation may solve this issue.
Currently if you don't have too many subtitles files to do a bulk translation, you can use the following command to do a manual-copy-and-paste translation. (Not listed in the readme)
autosub -i {file} -tapi man -of dst -doc -mts 9820 -tf txt -F ass
This will generate a txt file which contain a certain amount of words to be translated. Then you copy them to any of the translation website such as https://www.deepl.com/translator. After that you copy all the translation results from the website and then overwrite all the content in the previous txt. Then input enter in autosub and do these again until all the content being translated and the translated subtitles will be generated.
tried with the command and got the error "autosub: error: unrecognized arguments: -tapi man -mts 9820 -tf txt"
@zhenghan3 You need to use the latest dev version in the github repo dev branch.
Not working for me on MacOS:
$ git status
On branch dev
Your branch is up to date with 'origin/dev'.
nothing to commit, working tree clean
$
$ git log -n 1
commit 0d6687831e69195d31d66d503b50113a3939501f (HEAD -> dev, origin/dev, origin/HEAD)
Author: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Tue Mar 23 15:14:13 2021 +0800
Fix unable to type into the terminal after running
$
$ autosub -i out.mkv -S de-DE -D en -surl translate.google.com -slp 0.1
...
Sending short-term fragments to Google Speech V2 API and getting result.
Speech-to-Text: 100% |##############################################################################################################################################| Time: 0:07:15
Traceback (most recent call last):
...
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
Edit: after including the SRC
option it works:
$ autosub -i out.mkv -S de-DE -SRC de -D en
Convert source file to "/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/tmpd8rnw4uf.wav" to detect audio regions.
/usr/local/bin/ffmpeg -hide_banner -y -i "out.mkv" -vn -ac 1 -ar 48000 -loglevel error "/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/tmpd8rnw4uf.wav"
Use ffprobe to check conversion result.
/usr/local/bin/ffprobe "/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/tmpd8rnw4uf.wav" -show_format -pretty -loglevel quiet
[FORMAT]
filename=/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/tmpd8rnw4uf.wav
nb_streams=1
nb_programs=0
format_name=wav
format_long_name=WAV / WAVE (Waveform Audio)
start_time=N/A
duration=0:00:25.493333
size=2.334059 Mibyte
bit_rate=768.024000 Kbit/s
probe_score=99
TAG:encoder=Lavf58.45.100
[/FORMAT]
Conversion completed.
Use Auditok to detect speech regions.
Auditok detection completed.
"/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/tmpd8rnw4uf.wav" has been deleted.
Converting speech regions to short-term fragments.
Converting: 100% |##################################################################################################################################################| Time: 0:00:00
Sending short-term fragments to Google Speech V2 API and getting result.
Speech-to-Text: 100% |##############################################################################################################################################| Time: 0:00:04
Translating text from "de" to "en".
Translation: 100% |#################################################################################################################################################| Time: 0:00:00
Destination language subtitles file created at "/tmp/autosub/out.en.srt".
All work done.
20220510,[0.5.7-alpha]windows发布版使用翻译功能报错'NoneType' object has no attribute 'group',请问如何解决?
20220510,[0.5.7-alpha]windows发布版使用翻译功能报错'NoneType' object has no attribute 'group',请问如何解决?
https://github.com/BingLingGroup/autosub/issues/163#issuecomment-782791740
Make sure you have read the readme, searched and read the issues related to yours. Otherwise it will be considered as a duplicate which will be closed immediately.
Describe the bug Errors when trying to run. To Reproduce Steps to reproduce the behavior:
Ctrl-A
andCtrl-C
to copy all of them.Expected behavior A clear and concise description of what you expected to happen.
To complete without error.
Screenshots If applicable, add screenshots to help explain your problem. But it is not recommended using screenshots to demonstrate the commandline output unless you think it really matters.
Environment (please complete the following information):
Additional context (Optional) Add any other context about the problem here.