diff options
| author | Philipp Hagemeister <phihag@phihag.de> | 2014-10-24 15:17:17 +0200 | 
|---|---|---|
| committer | Philipp Hagemeister <phihag@phihag.de> | 2014-10-24 15:17:17 +0200 | 
| commit | 018e835594f961dfd625abc932451ef3c2c85038 (patch) | |
| tree | 456e5529b3057fbe426eebb1fb8658d1c095046e | |
| parent | e65e06fbe28365bf630608bb1d6101074c475e21 (diff) | |
[vidzi] Simplify
| -rw-r--r-- | youtube_dl/extractor/vidzi.py | 15 | 
1 files changed, 9 insertions, 6 deletions
diff --git a/youtube_dl/extractor/vidzi.py b/youtube_dl/extractor/vidzi.py index 7d93dd301..82d2179e9 100644 --- a/youtube_dl/extractor/vidzi.py +++ b/youtube_dl/extractor/vidzi.py @@ -1,6 +1,8 @@ -import re +from __future__ import unicode_literals +  from .common import InfoExtractor +  class VidziIE(InfoExtractor):      _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'      _TEST = { @@ -14,12 +16,13 @@ class VidziIE(InfoExtractor):      }      def _real_extract(self, url): -        mobj = re.match(self._VALID_URL, url) -        video_id = mobj.group('id') +        video_id = self._match_id(url) -        webpage = self._download_webpage('http://vidzi.tv/' + video_id, video_id) -        video_url = self._html_search_regex(r'{\s*file\s*:\s*"([^"]+)"\s*}', webpage, u'vidzi url') -        title = self._html_search_regex(r'<Title>([^<]+)<\/Title>', webpage, u'vidzi title') +        webpage = self._download_webpage(url, video_id) +        video_url = self._html_search_regex( +            r'{\s*file\s*:\s*"([^"]+)"\s*}', webpage, 'video url') +        title = self._html_search_regex( +            r'<Title>([^<]+)<\/Title>', webpage, 'title')          return {              'id': video_id,  | 
