aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-02-22 11:37:27 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-02-22 11:37:27 +0100
commit98c70d6fc7006c8cbbd76fb1b8661d758fc4f5d8 (patch)
treea78f559be6c02e35c10bf32f624c82f5aa73d8b3 /youtube_dl
parentab84349b16b3c94775543a04855fc77005f8237e (diff)
downloadyoutube-dl-98c70d6fc7006c8cbbd76fb1b8661d758fc4f5d8.tar.xz
[YoutubeDL] only add normal subtitles to the 'requested_subtitles' field if 'writesubtitles' is True
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/YoutubeDL.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 088b111eb..7319323e5 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -1156,11 +1156,13 @@ class YoutubeDL(object):
info_dict.update(formats_to_download[-1])
return info_dict
- def process_subtitles(self, video_id, available_subs, available_autocaps):
+ def process_subtitles(self, video_id, normal_subtitles, automatic_captions):
"""Select the requested subtitles and their format"""
- if available_autocaps and self.params.get('writeautomaticsub'):
- available_subs = available_subs.copy()
- for lang, cap_info in available_autocaps.items():
+ available_subs = {}
+ if normal_subtitles and self.params.get('writesubtitles'):
+ available_subs.update(normal_subtitles)
+ if automatic_captions and self.params.get('writeautomaticsub'):
+ for lang, cap_info in automatic_captions.items():
if lang not in available_subs:
available_subs[lang] = cap_info