about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-08-04 19:05:53 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:28:36 +0100
commit109626fcc09d1c27946871d2bdc40b9cdb33d7ee (patch)
treee769b6bbfe767eb4739566fc8721892dfef15c8b
parent204c9398ab2936a67e7daa9ea5fe989dbd382d5f (diff)
downloadyoutube-dl-109626fcc09d1c27946871d2bdc40b9cdb33d7ee.tar.gz
youtube-dl-109626fcc09d1c27946871d2bdc40b9cdb33d7ee.tar.xz
youtube-dl-109626fcc09d1c27946871d2bdc40b9cdb33d7ee.zip
Fix metacafe.com code not working due to gdaKey again (fixes issue #185)
-rwxr-xr-xyoutube-dl18
1 files changed, 9 insertions, 9 deletions
diff --git a/youtube-dl b/youtube-dl
index 266ed5854..09e1349a8 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -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: