mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-01-09 06:37:54 +01:00
[bbc] Fix errors
Fixes errors on news articles, archive pages, etc
This commit is contained in:
parent
73d8f3a634
commit
04eb2f977c
@ -608,9 +608,10 @@ class BBCIE(BBCCoUkIE):
|
|||||||
_VALID_URL = r'https?://(?:www\.)?bbc\.(?:com|co\.uk)/(?:[^/]+/)+(?P<id>[^/#?]+)'
|
_VALID_URL = r'https?://(?:www\.)?bbc\.(?:com|co\.uk)/(?:[^/]+/)+(?P<id>[^/#?]+)'
|
||||||
|
|
||||||
_MEDIASELECTOR_URLS = [
|
_MEDIASELECTOR_URLS = [
|
||||||
|
'https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/iptv-all/vpid/%s/format/xml/',
|
||||||
# Provides HQ HLS streams but fails with geolocation in some cases when it's
|
# Provides HQ HLS streams but fails with geolocation in some cases when it's
|
||||||
# even not geo restricted at all
|
# even not geo restricted at all
|
||||||
'http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/iptv-all/vpid/%s',
|
'http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/legacy-iptv-all/vpid/%s',
|
||||||
# Provides more formats, namely direct mp4 links, but fails on some videos with
|
# Provides more formats, namely direct mp4 links, but fails on some videos with
|
||||||
# notukerror for non UK (?) users (e.g.
|
# notukerror for non UK (?) users (e.g.
|
||||||
# http://www.bbc.com/travel/story/20150625-sri-lankas-spicy-secret)
|
# http://www.bbc.com/travel/story/20150625-sri-lankas-spicy-secret)
|
||||||
@ -977,20 +978,12 @@ class BBCIE(BBCCoUkIE):
|
|||||||
if entries:
|
if entries:
|
||||||
return self.playlist_result(entries, playlist_id, playlist_title, playlist_description)
|
return self.playlist_result(entries, playlist_id, playlist_title, playlist_description)
|
||||||
|
|
||||||
# http://www.bbc.co.uk/learningenglish/chinese/features/lingohack/ep-181227
|
|
||||||
group_id = self._search_regex(
|
|
||||||
r'<div[^>]+\bclass=["\']video["\'][^>]+\bdata-pid=["\'](%s)' % self._ID_REGEX,
|
|
||||||
webpage, 'group id', default=None)
|
|
||||||
if playlist_id:
|
|
||||||
return self.url_result(
|
|
||||||
'https://www.bbc.co.uk/programmes/%s' % group_id,
|
|
||||||
ie=BBCCoUkIE.ie_key())
|
|
||||||
|
|
||||||
# single video story (e.g. http://www.bbc.com/travel/story/20150625-sri-lankas-spicy-secret)
|
# single video story (e.g. http://www.bbc.com/travel/story/20150625-sri-lankas-spicy-secret)
|
||||||
programme_id = self._search_regex(
|
programme_id = self._search_regex(
|
||||||
[r'data-(?:video-player|media)-vpid="(%s)"' % self._ID_REGEX,
|
[r'data-(?:video-player|media)-vpid="(%s)"' % self._ID_REGEX,
|
||||||
r'<param[^>]+name="externalIdentifier"[^>]+value="(%s)"' % self._ID_REGEX,
|
r'<param[^>]+name="externalIdentifier"[^>]+value="(%s)"' % self._ID_REGEX,
|
||||||
r'videoId\s*:\s*["\'](%s)["\']' % self._ID_REGEX],
|
r'videoId\s*:\s*["\'](%s)["\']' % self._ID_REGEX,
|
||||||
|
r'"vpid":"(%s)"' % self._ID_REGEX],
|
||||||
webpage, 'vpid', default=None)
|
webpage, 'vpid', default=None)
|
||||||
|
|
||||||
if programme_id:
|
if programme_id:
|
||||||
@ -1014,6 +1007,15 @@ class BBCIE(BBCCoUkIE):
|
|||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# http://www.bbc.co.uk/learningenglish/chinese/features/lingohack/ep-181227
|
||||||
|
group_id = self._search_regex(
|
||||||
|
r'<div[^>]+\bclass=["\']video["\'][^>]+\bdata-pid=["\'](%s)' % self._ID_REGEX,
|
||||||
|
webpage, 'group id', default=None)
|
||||||
|
if playlist_id:
|
||||||
|
return self.url_result(
|
||||||
|
'https://www.bbc.co.uk/programmes/%s' % group_id,
|
||||||
|
ie=BBCCoUkIE.ie_key())
|
||||||
|
|
||||||
# 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