aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-04-20 12:06:58 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-04-20 12:06:58 +0200
commitf7a9721e16139ba3e7bce76d04c3b43ff932f698 (patch)
tree1ba1eb54c741b25c4f2ea86abc69bc1549429e8d /youtube_dl
parent089e843b0f9ae9f99be6406896829dc591f80122 (diff)
Fix some metacafe videos, closes #562
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/InfoExtractors.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index 5052f3ec8..8bfb2809b 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -731,8 +731,7 @@ class MetacafeIE(InfoExtractor):
return [self.url_result('http://www.youtube.com/watch?v=%s' % mobj2.group(1))]
# Retrieve video webpage to extract further information
- request = compat_urllib_request.Request('http://www.metacafe.com/watch/%s/' % video_id)
- webpage = self._download_webpage(request, video_id)
+ webpage = self._download_webpage('http://www.metacafe.com/watch/%s/' % video_id, video_id)
# Extract URL, uploader and title from webpage
self.report_extraction(video_id)
@@ -757,13 +756,13 @@ class MetacafeIE(InfoExtractor):
if 'mediaData' not in vardict:
self._downloader.report_error(u'unable to extract media URL')
return
- mobj = re.search(r'"mediaURL":"(http.*?)","key":"(.*?)"', vardict['mediaData'][0])
+ mobj = re.search(r'"mediaURL":"(?P<mediaURL>http.*?)",(.*?)"key":"(?P<key>.*?)"', vardict['mediaData'][0])
if mobj is None:
self._downloader.report_error(u'unable to extract media URL')
return
- mediaURL = mobj.group(1).replace('\\/', '/')
+ mediaURL = mobj.group('mediaURL').replace('\\/', '/')
video_extension = mediaURL[-3:]
- video_url = '%s?__gda__=%s' % (mediaURL, mobj.group(2))
+ video_url = '%s?__gda__=%s' % (mediaURL, mobj.group('key'))
mobj = re.search(r'(?im)<title>(.*) - Video</title>', webpage)
if mobj is None: