X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fmetacafe.py;h=234b9e80f3bf3fac48ff77f4c8b1ac9da7de2c7e;hb=9f1109a56424d118263963062bc5185d8415835e;hp=844a24efb56412e8b748386c0fa15663c4f7a5dd;hpb=896d5b63e83dd7fa19f0994adf0e7bb4a5896e8f;p=youtube-dl diff --git a/youtube_dl/extractor/metacafe.py b/youtube_dl/extractor/metacafe.py index 844a24efb..234b9e80f 100644 --- a/youtube_dl/extractor/metacafe.py +++ b/youtube_dl/extractor/metacafe.py @@ -23,7 +23,7 @@ class MetacafeIE(InfoExtractor): _TESTS = [{ u"add_ie": ["Youtube"], u"url": u"http://metacafe.com/watch/yt-_aUehQsCQtM/the_electric_company_short_i_pbs_kids_go/", - u"file": u"_aUehQsCQtM.flv", + u"file": u"_aUehQsCQtM.mp4", u"info_dict": { u"upload_date": u"20090102", u"title": u"The Electric Company | \"Short I\" | PBS KIDS GO!", @@ -37,7 +37,8 @@ class MetacafeIE(InfoExtractor): u"file": u"an-dVVXnuY7Jh77J.mp4", u"info_dict": { u"title": u"The Andromeda Strain (1971): Stop the Bomb Part 3", - u"uploader": u"AnyClip", + u"uploader": u"anyclip", + u"description": u"md5:38c711dd98f5bb87acf973d573442e67" } }] @@ -118,18 +119,19 @@ class MetacafeIE(InfoExtractor): video_url = '%s?__gda__=%s' % (mediaURL, mobj.group('key')) video_ext = determine_ext(video_url) - mobj = re.search(r'(?im)(.*) - Video', webpage) - if mobj is None: - raise ExtractorError(u'Unable to extract title') - video_title = mobj.group(1).decode('utf-8') - - video_uploader = self._html_search_regex(r'submitter=(.*?);|

\s*By\s*]*>(.*?)', webpage, u'uploader nickname', fatal=False) + video_title = self._html_search_regex(r'(?im)(.*) - Video', webpage, u'title') + description = self._og_search_description(webpage) + video_uploader = self._html_search_regex( + r'submitter=(.*?);|googletag\.pubads\(\)\.setTargeting\("(?:channel|submiter)","([^"]+)"\);', + webpage, u'uploader nickname', fatal=False) - return [{ + return { + '_type': 'video', 'id': video_id, 'url': video_url, + 'description': description, 'uploader': video_uploader, 'upload_date': None, 'title': video_title, 'ext': video_ext, - }] + }