diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-05-20 08:31:03 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-05-20 08:31:03 +0200 |
commit | 17bd1b2f4174f9ceb600faf2bd284b676b770c9f (patch) | |
tree | 3e074e3234b9ee08c90817d4654a94c12ba6901f /youtube_dl | |
parent | 5b0d3cc0cd10c737df20d87aa5842d18549c3c4c (diff) |
VineIE: extract more information and minor style changes
Diffstat (limited to 'youtube_dl')
-rwxr-xr-x | youtube_dl/InfoExtractors.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 551969a2e..64726e698 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -4116,21 +4116,35 @@ class VineIE(InfoExtractor): webpage_url = 'https://vine.co/v/' + video_id webpage = self._download_webpage(webpage_url, video_id) - mobj = re.search(r'<meta property="twitter:player:stream" content="([^"]+)"', webpage) + self.report_extraction(video_id) + + mobj = re.search(r'<meta property="twitter:player:stream" content="(.+?)"', webpage) if mobj is None: raise ExtractorError(u'Unable to extract video URL') video_url = mobj.group(1) - mobj = re.search(r'<meta property="og:title" content="([^"]+)"', webpage) + mobj = re.search(r'<meta property="og:title" content="(.+?)"', webpage) if mobj is None: raise ExtractorError(u'Unable to extract title') video_title = mobj.group(1) + mobj = re.search(r'<meta property="og:image" content="(.+?)(\?.*?)?"', webpage) + if mobj is None: + raise ExtractorError(u'Unable to extract thumbnail') + thumbnail = mobj.group(1) + + mobj = re.search(r'<div class="user">.*?<h2>(.+?)</h2>', webpage, re.DOTALL) + if mobj is None: + raise ExtractorError(u'Unable to extract uploader') + uploader = mobj.group(1) + return [{ - 'id': video_id, - 'url': video_url, - 'ext': 'mp4', - 'title': video_title, + 'id': video_id, + 'url': video_url, + 'ext': 'mp4', + 'title': video_title, + 'thumbnail': thumbnail, + 'uploader': uploader, }] def gen_extractors(): |