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

How to write subtitles into specified file name #3619

Closed
ghost opened this issue Aug 30, 2014 · 2 comments
Closed

How to write subtitles into specified file name #3619

ghost opened this issue Aug 30, 2014 · 2 comments

Comments

@ghost
Copy link

@ghost ghost commented Aug 30, 2014

Is there any way to write video subtitles into specified file name?

In my program I need to read subtitles. But youtube-dl write subtitles into unexpected file names.

So, I want to write subtitles into specific file names and read output srt files for subtitles. Is it possible?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 3, 2014

The filenames for the subtitles are predictable, you just replace the extension with {lang_code}.srt. For example, for youtube-dl 'QRS8MkLhQmM' --write-sub, the video filename is YouTube Captions and Subtitles-QRS8MkLhQmM.mp4 and the subtitles are saved to YouTube Captions and Subtitles-QRS8MkLhQmM.en.srt. If you want, you can specify the output template (for example -o "video.%(ext)s") or you can get the default filename by running youtube-dl 'QRS8MkLhQmM' --get-filename.

If you just need to get the subtiltes content, you can also use youtube-dl 'QRS8MkLhQmM' --write-sub --dump-json and look into the subtitles entry.

@ghost
Copy link
Author

@ghost ghost commented Sep 3, 2014

It's very useful answer. Thank you very much...

@jaimeMF jaimeMF closed this Jan 31, 2015
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
1 participant
You can’t perform that action at this time.