1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

[periscope] Support pscp.tv URLs in embedded frames

And fix a relevant twitter test
This commit is contained in:
Yen Chi Hsuan 2017-07-11 15:35:19 +08:00
parent 2edfd745df
commit 7f176ac477
No known key found for this signature in database
GPG Key ID: 7F902A182457CA23
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
version <unreleased> version <unreleased>
Extractors Extractors
+ [periscope] Support pscp.tv URLs in embedded frames
* [niconico] Fix authentication error handling (#12486) * [niconico] Fix authentication error handling (#12486)
* [giantbomb] Extract m3u8 formats (#13626) * [giantbomb] Extract m3u8 formats (#13626)

View File

@ -49,7 +49,7 @@ class PeriscopeIE(PeriscopeBaseIE):
@staticmethod @staticmethod
def _extract_url(webpage): def _extract_url(webpage):
mobj = re.search( mobj = re.search(
r'<iframe[^>]+src=([\'"])(?P<url>(?:https?:)?//(?:www\.)?periscope\.tv/(?:(?!\1).)+)\1', webpage) r'<iframe[^>]+src=([\'"])(?P<url>(?:https?:)?//(?:www\.)?(?:periscope|pscp)\.tv/(?:(?!\1).)+)\1', webpage)
if mobj: if mobj:
return mobj.group('url') return mobj.group('url')

View File

@ -335,10 +335,11 @@ class TwitterIE(InfoExtractor):
'info_dict': { 'info_dict': {
'id': '1zqKVVlkqLaKB', 'id': '1zqKVVlkqLaKB',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Sgt Kerry Schmidt - Ontario Provincial Police - Road rage, mischief, assault, rollover and fire in one occurrence', 'title': 'Sgt Kerry Schmidt - LIVE on #Periscope: Road rage, mischief, assault, rollover and fire in one occurrence',
'description': 'Sgt Kerry Schmidt on Twitter: "LIVE on #Periscope: Road rage, mischief, assault, rollover and fire in one occurrence https://t.co/EKrVgIXF3s"',
'upload_date': '20160923', 'upload_date': '20160923',
'uploader_id': 'OPP_HSD', 'uploader_id': 'OPP_HSD',
'uploader': 'Sgt Kerry Schmidt - Ontario Provincial Police', 'uploader': 'Sgt Kerry Schmidt',
'timestamp': 1474613214, 'timestamp': 1474613214,
}, },
'add_ie': ['Periscope'], 'add_ie': ['Periscope'],