From 24a1061f539076dd98ae21ac0b4b43fec248c95c Mon Sep 17 00:00:00 2001 From: dirkf Date: Wed, 3 Mar 2021 14:11:36 +0000 Subject: [PATCH] Get HD formats for Reel --- youtube_dl/extractor/bbc.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/bbc.py b/youtube_dl/extractor/bbc.py index 3556227cf..8046ad10b 100644 --- a/youtube_dl/extractor/bbc.py +++ b/youtube_dl/extractor/bbc.py @@ -995,7 +995,7 @@ class BBCIE(BBCCoUkIE): } # bbc reel (e.g. https://www.bbc.com/reel/video/p07c6sb6/how-positive-thinking-is-harming-your-happiness) - programme_id = self._search_regex( + programme_id = self._search_regex( r'/reel/video/(?P%s)/' % self._ID_REGEX, url, 'Reel pid', default=None) initial_data = self._parse_json(self._html_search_regex( r']+id=(["\'])initial-data\1[^>]+data-json=(["\'])(?P(?:(?!\2).)+)', @@ -1020,22 +1020,22 @@ class BBCIE(BBCCoUkIE): 'duration': int_or_none(clip_data.get('duration')), 'categories': [topic_title] if topic_title else None, } - + if not programme_id: # get the formats from the reel page formats, subtitles = self._download_media_selector(version_id) self._sort_formats(formats) ret.update({ - 'formats': formats, - 'subtitles': subtitles, + 'formats': formats, + 'subtitles': subtitles, }) else: # get the formats (including HD) from the programmes page # avoid https: to help proxying ret.update({ - '_type': 'url_transparent', - 'url': 'http://bbc.co.uk/programmes/%s' % programme_id - }) + '_type': 'url_transparent', + 'url': 'http://bbc.co.uk/programmes/%s' % programme_id + }) return ret elif programme_id: # the Reel page was not as expected: try the programmes page