[vidzi] Simplify
authorPhilipp Hagemeister <phihag@phihag.de>
Fri, 24 Oct 2014 13:17:17 +0000 (15:17 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 24 Oct 2014 13:17:17 +0000 (15:17 +0200)
youtube_dl/extractor/vidzi.py

index 7d93dd301d059213b4ebb4d392ec965fefa23188..82d2179e9a72d2527aacda2b781881b1e8fdcc1b 100644 (file)
@@ -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,