From a1a8713aadd48e32f8c53a1d8e673a2fdd4b91bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Tue, 18 Oct 2011 18:38:17 -0200 Subject: [PATCH 1/3] xvideos: Normalize the URL or it will fail with some inputs. For instance, if we give it , we would end up passing that to urllib2, which would complain about an unknown URL type. --- youtube-dl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube-dl b/youtube-dl index 450da8ebd..f8e9095ae 100755 --- a/youtube-dl +++ b/youtube-dl @@ -3413,7 +3413,7 @@ class XVideosIE(InfoExtractor): self.report_webpage(video_id) - request = urllib2.Request(url) + request = urllib2.Request(r'http://www.xvideos.com/video' + video_id) try: webpage = urllib2.urlopen(request).read() except (urllib2.URLError, httplib.HTTPException, socket.error), err: From 9f47175a405a8685463a6bc719e09359c0f7c5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Tue, 18 Oct 2011 18:41:02 -0200 Subject: [PATCH 2/3] xvideos: Fix misleading error message when extracting the URL. We said that we were trying to extract the title of the video. --- youtube-dl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube-dl b/youtube-dl index f8e9095ae..f895658fb 100755 --- a/youtube-dl +++ b/youtube-dl @@ -3426,7 +3426,7 @@ class XVideosIE(InfoExtractor): # Extract video URL mobj = re.search(r'flv_url=(.+?)&', webpage) if mobj is None: - self._downloader.trouble(u'ERROR: unable to extract video title') + self._downloader.trouble(u'ERROR: unable to extract video url') return video_url = urllib2.unquote(mobj.group(1).decode('utf-8')) From 0f9b77223e92a25eb1f4a626efcd7ff76beb9841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Tue, 18 Oct 2011 18:42:01 -0200 Subject: [PATCH 3/3] xvideos: Capture only the video title, not the name of the site. --- youtube-dl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube-dl b/youtube-dl index f895658fb..6770678d2 100755 --- a/youtube-dl +++ b/youtube-dl @@ -3432,7 +3432,7 @@ class XVideosIE(InfoExtractor): # Extract title - mobj = re.search(r'(.*?)', webpage) + mobj = re.search(r'(.*?)\s+-\s+XVID', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract video title') return