aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRogério Brito <rbrito@ime.usp.br>2011-10-18 19:47:19 -0200
committerPhilipp Hagemeister <phihag@phihag.de>2011-10-19 00:37:45 +0200
commitc424df0d2f121d33fd2a43ea50082584d9300ca2 (patch)
tree6abe332f06b5f3391e0231b03b9eacc14d3d1c63
parentd76736fc5eb0e1f17bad036082e7361b357730e6 (diff)
vimeo: Add the ability to detect if a video is available in HD. (Closes: #194)
-rwxr-xr-xyoutube-dl14
1 files changed, 13 insertions, 1 deletions
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'<isHD>(\d+)</isHD>', 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'<request_signature_expires>(.*?)</request_signature_expires>', 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