]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[YoutubeDL] Fix sanitizing subtitles' url
authorSergey M․ <dstftw@gmail.com>
Sun, 27 Mar 2016 21:13:39 +0000 (03:13 +0600)
committerSergey M․ <dstftw@gmail.com>
Sun, 27 Mar 2016 21:13:39 +0000 (03:13 +0600)
youtube_dl/YoutubeDL.py

index 53a36c145dc775b876cca41e732b7f7b312ec0a1..d7aa951ff39fc54238c5759ee5a57f2c70d9de0d 100755 (executable)
@@ -1265,7 +1265,8 @@ class YoutubeDL(object):
         if subtitles:
             for _, subtitle in subtitles.items():
                 for subtitle_format in subtitle:
-                    subtitle_format['url'] = sanitize_url(subtitle_format['url'])
+                    if subtitle_format.get('url'):
+                        subtitle_format['url'] = sanitize_url(subtitle_format['url'])
                     if 'ext' not in subtitle_format:
                         subtitle_format['ext'] = determine_ext(subtitle_format['url']).lower()