1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 16:44:32 +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: try:
formatsAndSubtitles = self._download_media_selector_url( formatsAndSubtitles = self._download_media_selector_url(
mediaselector_url % programme_id, programme_id) mediaselector_url % programme_id, programme_id)
formats += formatsAndSubtitles[0] # formats should always be set, but just in case
subtitles += formatsAndSubtitles[1] if formatsAndSubtitles[0]:
formats += formatsAndSubtitles[0]
# subtitles may never be set
if formatsAndSubtitles[1]:
subtitles += formatsAndSubtitles[1]
except BBCCoUkIE.MediaSelectionError as e: except BBCCoUkIE.MediaSelectionError as e:
if e.id in ('notukerror', 'geolocation', 'selectionunavailable'): if e.id in ('notukerror', 'geolocation', 'selectionunavailable'):
last_exception = e last_exception = e