X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=youtube-dl;h=831ec561f6cf24b0976ef3e6b0eac495540f5160;hb=c424df0d2f121d33fd2a43ea50082584d9300ca2;hp=450da8ebdbeb8f2e8030bcd9be70f6c1149ff6a5;hpb=6501a06d4641ffacfccd66d3de4ad5ab0f7db7fb;p=youtube-dl.git diff --git a/youtube-dl b/youtube-dl index 450da8e..831ec56 100755 --- a/youtube-dl +++ b/youtube-dl @@ -2059,6 +2059,18 @@ class VimeoIE(InfoExtractor): return sig = mobj.group(1).decode('utf-8') + # Vimeo specific: extract video quality information + mobj = re.search(r'(\d+)', webpage) + if mobj is None: + self._downloader.trouble(u'ERROR: unable to extract video quality information') + return + quality = mobj.group(1).decode('utf-8') + + if int(quality) == 1: + quality = 'hd' + else: + quality = 'sd' + # Vimeo specific: Extract request signature expiration mobj = re.search(r'(.*?)', webpage) if mobj is None: @@ -2066,7 +2078,7 @@ class VimeoIE(InfoExtractor): return sig_exp = mobj.group(1).decode('utf-8') - video_url = "http://vimeo.com/moogaloop/play/clip:%s/%s/%s" % (video_id, sig, sig_exp) + video_url = "http://vimeo.com/moogaloop/play/clip:%s/%s/%s/?q=%s" % (video_id, sig, sig_exp, quality) try: # Process video information @@ -3413,7 +3425,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: @@ -3426,13 +3438,13 @@ 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')) # 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