Browse Source

[pbs] Improve multipart video support (closes #12981)

master-ytdl-org
Sergey M․ 8 years ago
parent
commit
4947f13cd0
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      youtube_dl/extractor/pbs.py

+ 10
- 2
youtube_dl/extractor/pbs.py View File

@ -10,6 +10,7 @@ from ..utils import (
int_or_none, int_or_none,
float_or_none, float_or_none,
js_to_json, js_to_json,
orderedSet,
strip_jsonp, strip_jsonp,
strip_or_none, strip_or_none,
unified_strdate, unified_strdate,
@ -264,6 +265,13 @@ class PBSIE(InfoExtractor):
}, },
'playlist_count': 2, 'playlist_count': 2,
}, },
{
'url': 'http://www.pbs.org/wgbh/americanexperience/films/great-war/',
'info_dict': {
'id': 'great-war',
},
'playlist_count': 3,
},
{ {
'url': 'http://www.pbs.org/wgbh/americanexperience/films/death/player/', 'url': 'http://www.pbs.org/wgbh/americanexperience/films/death/player/',
'info_dict': { 'info_dict': {
@ -382,10 +390,10 @@ class PBSIE(InfoExtractor):
# tabbed frontline videos # tabbed frontline videos
MULTI_PART_REGEXES = ( MULTI_PART_REGEXES = (
r'<div[^>]+class="videotab[^"]*"[^>]+vid="(\d+)"', r'<div[^>]+class="videotab[^"]*"[^>]+vid="(\d+)"',
r'<a[^>]+href=["\']#video-\d+["\'][^>]+data-coveid=["\'](\d+)',
r'<a[^>]+href=["\']#(?:video-|part)\d+["\'][^>]+data-cove[Ii]d=["\'](\d+)',
) )
for p in MULTI_PART_REGEXES: for p in MULTI_PART_REGEXES:
tabbed_videos = re.findall(p, webpage)
tabbed_videos = orderedSet(re.findall(p, webpage))
if tabbed_videos: if tabbed_videos:
return tabbed_videos, presumptive_id, upload_date, description return tabbed_videos, presumptive_id, upload_date, description


Loading…
Cancel
Save