From: Rogério Brito Date: Tue, 18 Oct 2011 21:47:19 +0000 (-0200) Subject: vimeo: Add the ability to detect if a video is available in HD. X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=87929e4b35cf4a5a47c37715d029de68ccaa936f;p=youtube-dl.git vimeo: Add the ability to detect if a video is available in HD. --- diff --git a/youtube-dl b/youtube-dl index 6770678d2..831ec561f 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