mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-01-27 05:40:12 +09:00
Extend _MEDIA_SETS to get HD Reel videos
This commit is contained in:
parent
d6ed9424cd
commit
7a1e11c045
@ -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)
|
# 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<id>%s)/' % self._ID_REGEX, url, 'Reel pid', default=None)
|
r'/reel/video/(?P<id>%s)/' % self._ID_REGEX, url, 'Reel pid', default=None)
|
||||||
initial_data = self._parse_json(self._html_search_regex(
|
initial_data = self._parse_json(self._html_search_regex(
|
||||||
r'<script[^>]+id=(["\'])initial-data\1[^>]+data-json=(["\'])(?P<json>(?:(?!\2).)+)',
|
r'<script[^>]+id=(["\'])initial-data\1[^>]+data-json=(["\'])(?P<json>(?:(?!\2).)+)',
|
||||||
@ -1007,40 +1007,27 @@ class BBCIE(BBCCoUkIE):
|
|||||||
clip_data = try_get(smp_data, lambda x: x['items'][0], dict) or {}
|
clip_data = try_get(smp_data, lambda x: x['items'][0], dict) or {}
|
||||||
version_id = clip_data.get('versionID')
|
version_id = clip_data.get('versionID')
|
||||||
if version_id:
|
if version_id:
|
||||||
|
title = smp_data['title']
|
||||||
|
# also try for higher resolutions
|
||||||
|
self._MEDIA_SETS.insert(0,'iptv-all')
|
||||||
|
formats, subtitles = self._download_media_selector(version_id)
|
||||||
|
self._sort_formats(formats)
|
||||||
image_url = smp_data.get('holdingImageURL')
|
image_url = smp_data.get('holdingImageURL')
|
||||||
display_date = init_data.get('displayDate')
|
display_date = init_data.get('displayDate')
|
||||||
topic_title = init_data.get('topicTitle')
|
topic_title = init_data.get('topicTitle')
|
||||||
ret = {
|
return {
|
||||||
'title': smp_data.get('title', playlist_id),
|
|
||||||
'id': version_id,
|
'id': version_id,
|
||||||
|
'title': title
|
||||||
|
'formats': formats,
|
||||||
'alt_title': init_data.get('shortTitle'),
|
'alt_title': init_data.get('shortTitle'),
|
||||||
'thumbnail': image_url.replace('$recipe', 'raw') if image_url else None,
|
'thumbnail': image_url.replace('$recipe', 'raw') if image_url else None,
|
||||||
'description': smp_data.get('summary') or init_data.get('shortSummary'),
|
'description': smp_data.get('summary') or init_data.get('shortSummary'),
|
||||||
'upload_date': display_date.replace('-', '') if display_date else None,
|
'upload_date': display_date.replace('-', '') if display_date else None,
|
||||||
|
'subtitles': subtitles,
|
||||||
'duration': int_or_none(clip_data.get('duration')),
|
'duration': int_or_none(clip_data.get('duration')),
|
||||||
'categories': [topic_title] if topic_title else None,
|
'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,
|
|
||||||
})
|
|
||||||
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
|
|
||||||
})
|
|
||||||
return ret
|
|
||||||
elif programme_id:
|
|
||||||
# the Reel page was not as expected: try the programmes page
|
|
||||||
return self._url_result(programme_id)
|
|
||||||
|
|
||||||
# Morph based embed (e.g. http://www.bbc.co.uk/sport/live/olympics/36895975)
|
# Morph based embed (e.g. http://www.bbc.co.uk/sport/live/olympics/36895975)
|
||||||
# There are several setPayload calls may be present but the video
|
# There are several setPayload calls may be present but the video
|
||||||
# seems to be always related to the first one
|
# seems to be always related to the first one
|
||||||
|
Loading…
Reference in New Issue
Block a user