aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
authorIsmael Mejia <iemejia@gmail.com>2013-02-21 22:12:36 +0100
committerIsmael Mejia <iemejia@gmail.com>2013-02-21 22:12:36 +0100
commitcdb130b09a16865b81fd34d19b74fa634d45cad7 (patch)
treebd82790267b51435a4bfe6eddda77b4c2f32af15 /youtube_dl/__init__.py
parent2e5d60b7db7020b726cd54ee4cad8f2afbd1479d (diff)
Added new option '--only-srt' to download only the subtitles of a video
Improved option '--srt-lang' - it shows the argument in case of missing subtitles - added language suffix for non-english languages (e.g. video.it.srt)
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 23e3c2ac2..ababeac87 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -176,6 +176,9 @@ def parseOpts():
video_format.add_option('--write-srt',
action='store_true', dest='writesubtitles',
help='write video closed captions to a .srt file (currently youtube only)', default=False)
+ video_format.add_option('--only-srt',
+ action='store_true', dest='onlysubtitles',
+ help='downloads only the subtitles of the video (currently youtube only)', default=False)
video_format.add_option('--srt-lang',
action='store', dest='subtitleslang', metavar='LANG',
help='language of the closed captions to download (optional) use IETF language tags like \'en\'')
@@ -450,6 +453,7 @@ def _real_main():
'writedescription': opts.writedescription,
'writeinfojson': opts.writeinfojson,
'writesubtitles': opts.writesubtitles,
+ 'onlysubtitles': opts.onlysubtitles,
'subtitleslang': opts.subtitleslang,
'matchtitle': decodeOption(opts.matchtitle),
'rejecttitle': decodeOption(opts.rejecttitle),