youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit af63fed7d87c136a90e10d5632ce5f2e3f2ce8d8
parent 68d1d41c036b60a34f980a07e0f0adef66dc7864
Author: Philipp Hagemeister <phihag@phihag.de>
Date:   Thu, 13 Nov 2014 16:12:51 +0100

[generic] Add support for livestream embeds (Fixes #4185)

Diffstat:
Myoutube_dl/extractor/generic.py | 18+++++++++++++++++-
Myoutube_dl/extractor/livestream.py | 5++++-
2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py @@ -434,7 +434,17 @@ class GenericIE(InfoExtractor): 'title': 'Chet Chat 171 - Oct 29, 2014', 'upload_date': '20141029', } - } + }, + # Livestream embed + { + 'url': 'http://www.esa.int/Our_Activities/Space_Science/Rosetta/Philae_comet_touch-down_webcast', + 'info_dict': { + 'id': '67864563', + 'ext': 'flv', + 'upload_date': '20141112', + 'title': 'Rosetta #CometLanding webcast HL 10', + } + }, ] def report_following_redirect(self, new_url): @@ -916,6 +926,12 @@ class GenericIE(InfoExtractor): if mobj is not None: return self.url_result(self._proto_relative_url(mobj.group('url'), scheme='http:'), 'CondeNast') + mobj = re.search( + r'<iframe[^>]+src="(?P<url>https?://new\.livestream\.com/[^"]+/player[^"]+)"', + webpage) + if mobj is not None: + return self.url_result(mobj.group('url'), 'Livestream') + def check_video(vurl): vpath = compat_urlparse.urlparse(vurl).path vext = determine_ext(vpath) diff --git a/youtube_dl/extractor/livestream.py b/youtube_dl/extractor/livestream.py @@ -18,7 +18,7 @@ from ..utils import ( class LivestreamIE(InfoExtractor): IE_NAME = 'livestream' - _VALID_URL = r'http://new\.livestream\.com/.*?/(?P<event_name>.*?)(/videos/(?P<id>\d+))?/?$' + _VALID_URL = r'https?://new\.livestream\.com/.*?/(?P<event_name>.*?)(/videos/(?P<id>[0-9]+)(?:/player)?)?/?(?:$|[?#])' _TESTS = [{ 'url': 'http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370', 'md5': '53274c76ba7754fb0e8d072716f2292b', @@ -37,6 +37,9 @@ class LivestreamIE(InfoExtractor): 'title': 'TEDCity2.0 (English)', }, '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):