X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Flivestream.py;h=3642089f7802238d77ec5c18e4f96b5cb21e3d72;hb=265bfa2c79abc8f233132126be313ed2d4b18dc8;hp=363a12ad0ab53a53892b59623fbd92d1cbf98358;hpb=f24a5a2faab20e13c3a9f752f3d41fe66212d2c6;p=youtube-dl.git diff --git a/youtube_dl/extractor/livestream.py b/youtube_dl/extractor/livestream.py index 363a12ad0..3642089f7 100644 --- a/youtube_dl/extractor/livestream.py +++ b/youtube_dl/extractor/livestream.py @@ -4,10 +4,12 @@ import re import json from .common import InfoExtractor -from ..utils import ( +from ..compat import ( compat_str, compat_urllib_parse_urlparse, compat_urlparse, +) +from ..utils import ( ExtractorError, find_xpath_attr, int_or_none, @@ -18,7 +20,7 @@ from ..utils import ( class LivestreamIE(InfoExtractor): IE_NAME = 'livestream' - _VALID_URL = r'http://new\.livestream\.com/.*?/(?P.*?)(/videos/(?P\d+))?/?$' + _VALID_URL = r'https?://new\.livestream\.com/.*?/(?P.*?)(/videos/(?P[0-9]+)(?:/player)?)?/?(?:$|[?#])' _TESTS = [{ 'url': 'http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370', 'md5': '53274c76ba7754fb0e8d072716f2292b', @@ -35,8 +37,12 @@ class LivestreamIE(InfoExtractor): 'url': 'http://new.livestream.com/tedx/cityenglish', 'info_dict': { 'title': 'TEDCity2.0 (English)', + 'id': '2245590', }, 'playlist_mincount': 4, + }, { + 'url': 'https://new.livestream.com/accounts/362/events/3557232/videos/67864563/player?autoPlay=false&height=360&mute=false&width=640', + 'only_matching': True, }] def _parse_smil(self, video_id, smil_url): @@ -143,7 +149,8 @@ class LivestreamIE(InfoExtractor): if is_relevant(video_data, video_id)] if video_id is None: # This is an event page: - return self.playlist_result(videos, info['id'], info['full_name']) + return self.playlist_result( + videos, '%s' % info['id'], info['full_name']) else: if not videos: raise ExtractorError('Cannot find video %s' % video_id)