X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fmetacafe.py;h=858c1c0c31f4c08c3068a62983781129288dc3b8;hb=9e1a5b845586a0a5431fb72467142046d8571e6f;hp=3176ec2301a1ea467a4abd08108067bf62302faf;hpb=be3b8fa30f9b1fdc47a0f37678fec63fcf321c1d;p=youtube-dl diff --git a/youtube_dl/extractor/metacafe.py b/youtube_dl/extractor/metacafe.py index 3176ec230..858c1c0c3 100644 --- a/youtube_dl/extractor/metacafe.py +++ b/youtube_dl/extractor/metacafe.py @@ -9,11 +9,12 @@ from ..utils import ( compat_urllib_request, determine_ext, ExtractorError, + int_or_none, ) class MetacafeIE(InfoExtractor): - _VALID_URL = r'(?:http://)?(?:www\.)?metacafe\.com/watch/([^/]+)/([^/]+)/.*' + _VALID_URL = r'http://(?:www\.)?metacafe\.com/watch/([^/]+)/([^/]+)/.*' _DISCLAIMER = 'http://www.metacafe.com/family_filter/' _FILTER_POST = 'http://www.metacafe.com/f/index.php?inputType=filter&controllerGroup=user' IE_NAME = 'metacafe' @@ -21,12 +22,12 @@ class MetacafeIE(InfoExtractor): # Youtube video { 'add_ie': ['Youtube'], - 'url': 'http://metacafe.com/watch/yt-_aUehQsCQtM/the_electric_company_short_i_pbs_kids_go/', + 'url': 'http://metacafe.com/watch/yt-_aUehQsCQtM/the_electric_company_short_i_pbs_kids_go/', 'info_dict': { 'id': '_aUehQsCQtM', 'ext': 'mp4', 'upload_date': '20090102', - 'title': 'The Electric Company | \"Short I\" | PBS KIDS GO!', + 'title': 'The Electric Company | "Short I" | PBS KIDS GO!', 'description': 'md5:2439a8ef6d5a70e380c22f5ad323e5a8', 'uploader': 'PBS', 'uploader_id': 'PBS' @@ -70,23 +71,37 @@ class MetacafeIE(InfoExtractor): }, # cbs video { - 'url': 'http://www.metacafe.com/watch/cb-0rOxMBabDXN6/samsung_galaxy_note_2_samsungs_next_generation_phablet/', + 'url': 'http://www.metacafe.com/watch/cb-8VD4r_Zws8VP/open_this_is_face_the_nation_february_9/', 'info_dict': { - 'id': '0rOxMBabDXN6', + 'id': '8VD4r_Zws8VP', 'ext': 'flv', - 'title': 'Samsung Galaxy Note 2: Samsung\'s next-generation phablet', - 'description': 'md5:54d49fac53d26d5a0aaeccd061ada09d', - 'duration': 129, + 'title': 'Open: This is Face the Nation, February 9', + 'description': 'md5:8a9ceec26d1f7ed6eab610834cc1a476', + 'duration': 96, }, 'params': { # rtmp download 'skip_download': True, }, }, + # Movieclips.com video + { + 'url': 'http://www.metacafe.com/watch/mv-Wy7ZU/my_week_with_marilyn_do_you_love_me/', + 'info_dict': { + 'id': 'mv-Wy7ZU', + 'ext': 'mp4', + 'title': 'My Week with Marilyn - Do You Love Me?', + 'description': 'From the movie My Week with Marilyn - Colin (Eddie Redmayne) professes his love to Marilyn (Michelle Williams) and gets her to promise to return to set and finish the movie.', + 'uploader': 'movie_trailers', + 'duration': 176, + }, + 'params': { + 'skip_download': 'requires rtmpdump', + } + } ] def report_disclaimer(self): - """Report disclaimer retrieval.""" self.to_screen('Retrieving disclaimer') def _real_initialize(self): @@ -135,6 +150,7 @@ class MetacafeIE(InfoExtractor): # Extract URL, uploader and title from webpage self.report_extraction(video_id) + video_url = None mobj = re.search(r'(?m)&mediaURL=([^&]+)', webpage) if mobj is not None: mediaURL = compat_urllib_parse.unquote(mobj.group(1)) @@ -147,16 +163,17 @@ class MetacafeIE(InfoExtractor): else: gdaKey = mobj.group(1) video_url = '%s?__gda__=%s' % (mediaURL, gdaKey) - else: + if video_url is None: mobj = re.search(r'