Compare commits

...

4 Commits

Author SHA1 Message Date
df 9fd7a46a89 Try all possible mediaselectors even if one succeeds 2020-11-04 01:53:05 +00:00
df c645b8a983 Try all possible mediaselectors even if one succeeds 2020-11-04 01:50:49 +00:00
df be50054bb6 Try all possible mediaselectors even if one succeeds
Simplify and correct
2020-10-14 11:47:40 +00:00
df 0bef1c757b Try all possible mediaselectors even if one succeeds
Some mediaselectors may be parseable but have no formats (eg captions only), eg https://www.bbc.co.uk/iplayer/episode/b0b3px4q.

This revision tries all possible mediaselectors and assembles the formats and subtitles found.

If any formats are found, the known exceptions ('notukerror', 'geolocation', 'selectionunavailable') are not propagated.
2020-10-13 15:35:22 +00:00
1 changed files with 15 additions and 2 deletions

View File

@ -350,16 +350,29 @@ class BBCCoUkIE(InfoExtractor):
def _download_media_selector(self, programme_id):
last_exception = None
formats = []
subtitles = None
for mediaselector_url in self._MEDIASELECTOR_URLS:
try:
return self._download_media_selector_url(
formatsAndSubtitles = self._download_media_selector_url(
mediaselector_url % programme_id, programme_id)
# formats (a list) should always be set, but just in case
if formatsAndSubtitles[0]:
formats += formatsAndSubtitles[0]
# subtitles (dict {lang,sttl})
if formatsAndSubtitles[1]:
if subtitles:
# prioritise the first sttl for each lang
formatsAndSubtitles[1].update(subtitles)
subtitles = formatsAndSubtitles[1]
except BBCCoUkIE.MediaSelectionError as e:
if e.id in ('notukerror', 'geolocation', 'selectionunavailable'):
last_exception = e
continue
self._raise_extractor_error(e)
self._raise_extractor_error(last_exception)
if last_exception and not formats:
self._raise_extractor_error(last_exception)
return formats, subtitles
def _download_media_selector_url(self, url, programme_id=None):
media_selection = self._download_xml(