Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate subtitles (captions) option #4555

Closed
beltex opened this issue Dec 24, 2014 · 6 comments
Closed

Translate subtitles (captions) option #4555

beltex opened this issue Dec 24, 2014 · 6 comments
Assignees

Comments

@beltex
Copy link

@beltex beltex commented Dec 24, 2014

First off, thanks for the awesome project! :)

I’m running into a case were the video in question only has subtitles in a single language and no automatic captions. YouTube provides the option to automatically translate the subtitles to another language (Translate captions option under settings). Adding the option to invoke the auto-translator for subtitles would be handy.

From an options perspective, one possibility could be that when --sub-lang is invoked, if the desired language is not available natively, then the auto-translator is used. Otherwise, something like a --sub-trans option could be added.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 24, 2014

You can use the --write-auto-sub option, for example: youtube-dl '8YoUxe5ncPo' --write-auto-sub --sub-lang 'es,it'

@jaimeMF jaimeMF closed this Dec 24, 2014
@beltex
Copy link
Author

@beltex beltex commented Dec 24, 2014

That doesn't work in my case though unfortunately. As mentioned, the video doesn't have automatic captions, it only has subtitles in a single language (which I want to invoke translate on). Thus, the following is output (using the above commands)

WARNING: Video doesn't have automatic captions
@phihag
Copy link
Contributor

@phihag phihag commented Dec 24, 2014

@beltex Can you post the full output you get when you run youtube-dl with -v? I suspect that you're either using an outdated verison or not using the example video that @jaimeMF mentioned.

@beltex
Copy link
Author

@beltex beltex commented Dec 24, 2014

@phihag I’m running the latest version, installed via Homebrew yesterday. The example given by @jaimeMF is different than my case, it has automatic captions, but no subtitles. Here's my case:

$ youtube-dl -v --write-auto-sub --sub-lang en https://www.youtube.com/watch?v=Ky9eprVWzlI
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--write-auto-sub', '--sub-lang', 'en', 'https://www.youtube.com/watch?v=Ky9eprVWzlI']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.12.17.2
[debug] Python version 2.7.5 - Darwin-13.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.2.4, ffprobe 2.2.4
[debug] Proxy map: {}
[youtube] Ky9eprVWzlI: Downloading webpage
[youtube] Ky9eprVWzlI: Extracting video information
[youtube] Ky9eprVWzlI: Looking for automatic captions
[youtube] Ky9eprVWzlI: Downloading XML
WARNING: Video doesn't have automatic captions
[youtube] Ky9eprVWzlI: Downloading DASH manifest
[debug] Invoking downloader on u'https://r8---sn-gvbxgn-tt1z.googlevideo.com/videoplayback?mm=31&key=yt5&expire=1419457043&id=o-ACK96ozbPuoVz8ziDXZCGk8ZKazQ4P_XiO_2xtxW1hLy&initcwndbps=2102500&ipbits=0&sparams=dur%2Chightc%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mv=m&hightc=yes&ms=au&requiressl=yes&source=youtube&ratebypass=yes&sver=3&mt=1419435379&signature=92E2FF0EEAE8DF328C26F32DA8FA563CC8D7ADD9.36BDA6B7EE5EE45FB515B93EBC77187FC7D72BDB&ip=&dur=2665.418&mime=video%2Fmp4&itag=18&fexp=900718%2C904833%2C927622%2C932404%2C9405911%2C943917%2C945091%2C946008%2C947209%2C947218%2C947602%2C948124%2C949427%2C952302%2C952605%2C952901%2C955301%2C957103%2C957105%2C957201%2C959701&upn=Fn1XE-UIMcI'
[download] Ky9eprVWzlI.mp4 has already been downloaded
@jaimeMF jaimeMF reopened this Dec 31, 2014
@jaimeMF jaimeMF self-assigned this Dec 31, 2014
@jaimeMF jaimeMF closed this in 7d900ef Dec 31, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 31, 2014

It will work in the next version, thanks for the report.

As you have seen, not posting even the url makes it really hard to give good answers or fix the issue.

@beltex
Copy link
Author

@beltex beltex commented Dec 31, 2014

Awesome, thank you very much @jaimeMF!

My apologies, I will make sure to do so next time! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.