From 94f4d75bf644c8066ee27be36fbe76225517f9db Mon Sep 17 00:00:00 2001 From: dirkf Date: Tue, 13 Oct 2020 10:49:27 +0000 Subject: [PATCH] Update bbc.py The list of subtitles is initialised to None and may never become a list if no captions are found in the playlists. --- youtube_dl/extractor/bbc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/bbc.py b/youtube_dl/extractor/bbc.py index a67ced3f6..76dfa0598 100644 --- a/youtube_dl/extractor/bbc.py +++ b/youtube_dl/extractor/bbc.py @@ -359,8 +359,12 @@ class BBCCoUkIE(InfoExtractor): try: formatsAndSubtitles = self._download_media_selector_url( mediaselector_url % programme_id, programme_id) - formats += formatsAndSubtitles[0] - subtitles += formatsAndSubtitles[1] + # formats should always be set, but just in case + if formatsAndSubtitles[0]: + formats += formatsAndSubtitles[0] + # subtitles may never be set + if formatsAndSubtitles[1]: + subtitles += formatsAndSubtitles[1] except BBCCoUkIE.MediaSelectionError as e: if e.id in ('notukerror', 'geolocation', 'selectionunavailable'): last_exception = e