diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 53a36c145d..d7aa951ff3 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1265,7 +1265,8 @@ def process_video_result(self, info_dict, download=True): 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()