mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 02:25:11 +00:00
[pbs] Add support for tabbed frontline videos (Closes #4006)
This commit is contained in:
parent
6b445558ff
commit
9bbec55255
1 changed files with 19 additions and 1 deletions
|
@ -80,8 +80,14 @@ class PBSIE(InfoExtractor):
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
'upload_date': '20140122',
|
'upload_date': '20140122',
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.pbs.org/wgbh/pages/frontline/united-states-of-secrets/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'united-states-of-secrets',
|
||||||
|
},
|
||||||
|
'playlist_count': 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def _extract_webpage(self, url):
|
def _extract_webpage(self, url):
|
||||||
|
@ -96,6 +102,12 @@ def _extract_webpage(self, url):
|
||||||
r'<input type="hidden" id="air_date_[0-9]+" value="([^"]+)"',
|
r'<input type="hidden" id="air_date_[0-9]+" value="([^"]+)"',
|
||||||
webpage, 'upload date', default=None))
|
webpage, 'upload date', default=None))
|
||||||
|
|
||||||
|
# tabbed frontline videos
|
||||||
|
tabbed_videos = re.findall(
|
||||||
|
r'<div[^>]+class="videotab[^"]*"[^>]+vid="(\d+)"', webpage)
|
||||||
|
if tabbed_videos:
|
||||||
|
return tabbed_videos, presumptive_id, upload_date
|
||||||
|
|
||||||
MEDIA_ID_REGEXES = [
|
MEDIA_ID_REGEXES = [
|
||||||
r"div\s*:\s*'videoembed'\s*,\s*mediaid\s*:\s*'(\d+)'", # frontline video embed
|
r"div\s*:\s*'videoembed'\s*,\s*mediaid\s*:\s*'(\d+)'", # frontline video embed
|
||||||
r'class="coveplayerid">([^<]+)<', # coveplayer
|
r'class="coveplayerid">([^<]+)<', # coveplayer
|
||||||
|
@ -130,6 +142,12 @@ def _extract_webpage(self, url):
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id, display_id, upload_date = self._extract_webpage(url)
|
video_id, display_id, upload_date = self._extract_webpage(url)
|
||||||
|
|
||||||
|
if isinstance(video_id, list):
|
||||||
|
entries = [self.url_result(
|
||||||
|
'http://video.pbs.org/video/%s' % vid_id, 'PBS', vid_id)
|
||||||
|
for vid_id in video_id]
|
||||||
|
return self.playlist_result(entries, display_id)
|
||||||
|
|
||||||
info_url = 'http://video.pbs.org/videoInfo/%s?format=json' % video_id
|
info_url = 'http://video.pbs.org/videoInfo/%s?format=json' % video_id
|
||||||
info = self._download_json(info_url, display_id)
|
info = self._download_json(info_url, display_id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue