1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 10:24:33 +01:00

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.
This commit is contained in:
dirkf 2020-10-13 10:49:27 +00:00 committed by GitHub
parent f9588ec2cd
commit 94f4d75bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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