Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Enable option to select subtitle formats
Browse files Browse the repository at this point in the history
  • Loading branch information
bartronicus committed Apr 4, 2019
1 parent b34babc commit 4bc1caa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ var options = {
auto: false,
// Downloads all the available subtitles.
all: false,
// Subtitle format. YouTube generated subtitles
// are available ttml or vtt.
format: 'ttml',
// Languages of subtitles to download, separated by commas.
lang: 'en',
// The directory to save the downloaded files in.
Expand Down
4 changes: 4 additions & 0 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ ytdl.getInfo = function getInfo(url, args, options, callback) {
* {Boolean} auto
* {Boolean} all
* {String} lang
* {String} format
* {String} cwd
* @param {Function(!Error, Object)} callback
*/
Expand All @@ -349,6 +350,9 @@ ytdl.getSubs = function getSubs(url, options, callback) {
if (options.lang) {
args.push('--sub-lang=' + options.lang);
}
if (options.format) {
args.push('--sub-format=' + options.format);
}
if (!options.warrning) {
args.push('--no-warnings');
}
Expand Down

0 comments on commit 4bc1caa

Please sign in to comment.