Browse Source

Fix issue #8109 (error when downloading automatic captions)

Dimitre Liotev 9 years ago
parent
commit
582f4f834e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      youtube_dl/extractor/youtube.py

+ 3 - 0
youtube_dl/extractor/youtube.py

@@ -964,6 +964,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         try:
         try:
             args = player_config['args']
             args = player_config['args']
             caption_url = args['ttsurl']
             caption_url = args['ttsurl']
+            if caption_url is None or caption_url == "" or caption_url.isspace():
+                self._downloader.report_warning("No automatic captions")
+                return {}
             timestamp = args['timestamp']
             timestamp = args['timestamp']
             # We get the available subtitles
             # We get the available subtitles
             list_params = compat_urllib_parse.urlencode({
             list_params = compat_urllib_parse.urlencode({