Created
August 3, 2016 17:44
-
-
Save underr/73434b10f18376489fe414c70644d432 to your computer and use it in GitHub Desktop.
tr*psubs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from yandex_translate import YandexTranslate | |
import os | |
progresso=0 | |
translate = YandexTranslate('APIKEY') | |
with open('subs.srt') as f: | |
content = f.readlines() | |
tamanho=len(content) | |
saida = open('out.srt','w') | |
for line in content: | |
progresso=progresso+1 | |
saida.write(translate.translate(line, 'en-pt')['text'][0]) | |
os.system('clear') | |
print("Traduzindo...") | |
print(progresso, 'de', str(tamanho)) | |
saida.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment