Browse Source

YoutubeIE: If not subtitles language is given default to English for automatic captions (related #901)

Jaime Marquínez Ferrándiz 12 năm trước cách đây
mục cha
commit
e704f4d378
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      youtube_dl/InfoExtractors.py

+ 1 - 1
youtube_dl/InfoExtractors.py

@@ -420,7 +420,7 @@ class YoutubeIE(InfoExtractor):
     def _request_automatic_caption(self, video_id, webpage):
         """We need the webpage for getting the captions url, pass it as an
            argument to speed up the process."""
-        sub_lang = self._downloader.params.get('subtitleslang')
+        sub_lang = self._downloader.params.get('subtitleslang') or 'en'
         sub_format = self._downloader.params.get('subtitlesformat')
         self.to_screen(u'%s: Looking for automatic captions' % video_id)
         mobj = re.search(r';ytplayer.config = ({.*?});', webpage)