From 17bd1b2f4174f9ceb600faf2bd284b676b770c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Mon, 20 May 2013 08:31:03 +0200 Subject: [PATCH] VineIE: extract more information and minor style changes --- test/tests.json | 3 ++- youtube_dl/InfoExtractors.py | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/test/tests.json b/test/tests.json index 195051556..1ff9ad7ee 100644 --- a/test/tests.json +++ b/test/tests.json @@ -458,7 +458,8 @@ "file": "b9KOOWX7HUx.mp4", "md5": "2f36fed6235b16da96ce9b4dc890940d", "info_dict":{ - "title":"Chicken." + "title": "Chicken.", + "uploader": "Jack Dorsey" } } ] 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 @@ def _real_extract(self, url): webpage_url = 'https://vine.co/v/' + video_id webpage = self._download_webpage(webpage_url, video_id) - mobj = re.search(r'.*?

(.+?)

', 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():