diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-06-25 23:45:16 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-06-25 23:46:24 +0200 |
commit | b004821fa98a5ac563811f37b744c632dd58d559 (patch) | |
tree | e9ceb5130a6613803e1c08e472d07e4de14cff28 /youtube_dl/extractor | |
parent | 81b42336ad9a59167a2c936bbd58f818007b1872 (diff) |
Add the option "--write-auto-sub" to download automatic subtitles from Youtube
Now automatic subtitles are only downloaded if the option is given.
(closes #903)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index de653cb3d..6728f5418 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -454,14 +454,13 @@ class YoutubeIE(InfoExtractor): if video_subtitles: (sub_error, sub_lang, sub) = video_subtitles[0] if sub_error: - # We try with the automatic captions - video_subtitles = self._request_automatic_caption(video_id, video_webpage) - (sub_error_auto, sub_lang, sub) = video_subtitles[0] - if sub is not None: - pass - else: - # We report the original error - self._downloader.report_warning(sub_error) + self._downloader.report_warning(sub_error) + + if self._downloader.params.get('writeautomaticsub', False): + video_subtitles = self._request_automatic_caption(video_id, video_webpage) + (sub_error, sub_lang, sub) = video_subtitles[0] + if sub_error: + self._downloader.report_warning(sub_error) if self._downloader.params.get('allsubtitles', False): video_subtitles = self._extract_all_subtitles(video_id) |