mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 18:41:29 +00:00
[pbs] Switch to portal player by default (Closes #8491)
This commit is contained in:
parent
cc799437ea
commit
7fcea295c5
|
@ -8,6 +8,7 @@
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
js_to_json,
|
||||||
strip_jsonp,
|
strip_jsonp,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
US_RATINGS,
|
US_RATINGS,
|
||||||
|
@ -432,9 +433,20 @@ def _real_extract(self, url):
|
||||||
for vid_id in video_id]
|
for vid_id in video_id]
|
||||||
return self.playlist_result(entries, display_id)
|
return self.playlist_result(entries, display_id)
|
||||||
|
|
||||||
info = self._download_json(
|
player = self._download_webpage(
|
||||||
'http://player.pbs.org/videoInfo/%s?format=json&type=partner' % video_id,
|
'http://player.pbs.org/portalplayer/%s' % video_id, display_id)
|
||||||
display_id)
|
|
||||||
|
info = self._parse_json(
|
||||||
|
self._search_regex(
|
||||||
|
r'(?s)PBS\.videoData\s*=\s*({.+?});\n',
|
||||||
|
player, 'video data', default='{}'),
|
||||||
|
display_id, transform_source=js_to_json, fatal=False)
|
||||||
|
|
||||||
|
# Fallback to old videoInfo API
|
||||||
|
if not info:
|
||||||
|
info = self._download_json(
|
||||||
|
'http://player.pbs.org/videoInfo/%s?format=json&type=partner' % video_id,
|
||||||
|
display_id, 'Downloading video info JSON')
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for encoding_name in ('recommended_encoding', 'alternate_encoding'):
|
for encoding_name in ('recommended_encoding', 'alternate_encoding'):
|
||||||
|
|
Loading…
Reference in a new issue