Fix metacafe.com code not working due to gdaKey again (fixes issue #185)
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Wed, 4 Aug 2010 17:05:53 +0000 (19:05 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:28:36 +0000 (11:28 +0100)
youtube-dl

index 266ed585424b684ed8ca5cecb5213e9657b7a0c2..09e1349a8248106f6718cf51745c6cbf385c0ce0 100755 (executable)
@@ -1039,15 +1039,15 @@ class MetacafeIE(InfoExtractor):
                        return
                mediaURL = urllib.unquote(mobj.group(1))
 
-               #mobj = re.search(r'(?m)&gdaKey=(.*?)&', webpage)
-               #if mobj is None:
-               #       self._downloader.trouble(u'ERROR: unable to extract gdaKey')
-               #       return
-               #gdaKey = mobj.group(1)
-               #
-               #video_url = '%s?__gda__=%s' % (mediaURL, gdaKey)
-
-               video_url = mediaURL
+               # Extract gdaKey if available
+               mobj = re.search(r'(?m)&gdaKey=(.*?)&', webpage)
+               if mobj is None:
+                       video_url = mediaURL
+                       #self._downloader.trouble(u'ERROR: unable to extract gdaKey')
+                       #return
+               else:
+                       gdaKey = mobj.group(1)
+                       video_url = '%s?__gda__=%s' % (mediaURL, gdaKey)
 
                mobj = re.search(r'(?im)<title>(.*) - Video</title>', webpage)
                if mobj is None: