mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-02 12:02:49 -05:00
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)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user