mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-25 01:01:39 +00:00
vimeo: Add the ability to detect if a video is available in HD. (Closes: #194)
This commit is contained in:
parent
d76736fc5e
commit
c424df0d2f
1 changed files with 13 additions and 1 deletions
14
youtube-dl
14
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
|
||||
|
|
Loading…
Reference in a new issue