diff options
author | Rogério Brito <rbrito@ime.usp.br> | 2011-02-21 21:52:48 -0300 |
---|---|---|
committer | Rogério Brito <rbrito@ime.usp.br> | 2011-02-21 21:52:48 -0300 |
commit | 1a3fe4212fc1480887431a0b83bcaafe27fd946c (patch) | |
tree | 4edc96fb98c4a53d74cd1d18129908375231674c /youtube-dl | |
parent | c4cfbdf5a5ce8203aea55d27a4a3f0e1b495fafc (diff) | |
parent | 7f69fd3b3910b76358ee7cf03dcfe656643eca34 (diff) | |
download | youtube-dl-1a3fe4212fc1480887431a0b83bcaafe27fd946c.zip youtube-dl-1a3fe4212fc1480887431a0b83bcaafe27fd946c.tar.gz youtube-dl-1a3fe4212fc1480887431a0b83bcaafe27fd946c.tar.bz2 |
Merge branch 'vimeo' of ssh://github.com/rbrito/youtube-dl into vimeo
Diffstat (limited to 'youtube-dl')
-rwxr-xr-x | youtube-dl | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1724,7 +1724,7 @@ class VimeoIE(InfoExtractor): """Information extractor for vimeo.com.""" # _VALID_URL matches Vimeo URLs - _VALID_URL = r'(?:http://)?vimeo\.com/([0-9]+)' + _VALID_URL = r'(?:http://)?(?:(?:www|player).)?vimeo\.com/(?:video/)?([0-9]+)' def __init__(self, downloader=None): InfoExtractor.__init__(self, downloader) @@ -1765,8 +1765,12 @@ class VimeoIE(InfoExtractor): self._downloader.trouble(u'ERROR: Unable to retrieve video webpage: %s' % str(err)) return - # Extract uploader and title from webpage + # Now we begin extracting as much information as we can from what we + # retrieved. First we extract the information common to all extractors, + # and latter we extract those that are Vimeo specific. self.report_extraction(video_id) + + # Extract title mobj = re.search(r'<caption>(.*?)</caption>', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract video title') @@ -1774,6 +1778,7 @@ class VimeoIE(InfoExtractor): video_title = mobj.group(1).decode('utf-8') simple_title = re.sub(ur'(?u)([^%s]+)' % simple_title_chars, ur'_', video_title) + # Extract uploader mobj = re.search(r'<uploader_url>http://vimeo.com/(.*?)</uploader_url>', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract video uploader') @@ -1796,14 +1801,14 @@ class VimeoIE(InfoExtractor): # if not video_description: video_description = 'No description available.' video_description = 'Foo.' - # Extract request signature + # Vimeo specific: extract request signature mobj = re.search(r'<request_signature>(.*?)</request_signature>', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract request signature') return sig = mobj.group(1).decode('utf-8') - # Extract request signature expiration + # Vimeo specific: Extract request signature expiration mobj = re.search(r'<request_signature_expires>(.*?)</request_signature_expires>', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract request signature expiration') |