vidzi Add new extractor
authorwinwon <wish4read@gmail.com>
Fri, 17 Oct 2014 16:38:16 +0000 (17:38 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 24 Oct 2014 13:15:13 +0000 (15:15 +0200)
youtube_dl/extractor/__init__.py
youtube_dl/extractor/vidzi.py [new file with mode: 0644]

index 3023c3095dc1854a6e8c9b5f303ad22edcc6c38a..b52f8c7d11a4a1479fe23d730d8d7244ca379dd3 100644 (file)
@@ -493,7 +493,7 @@ from .youtube import (
 )
 
 from .zdf import ZDFIE
-
+from .vidzi import VidziIE
 
 _ALL_CLASSES = [
     klass
diff --git a/youtube_dl/extractor/vidzi.py b/youtube_dl/extractor/vidzi.py
new file mode 100644 (file)
index 0000000..7d93dd3
--- /dev/null
@@ -0,0 +1,30 @@
+import re
+from .common import InfoExtractor
+
+class VidziIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
+    _TEST = {
+        'url': 'http://vidzi.tv/m1chxrwq7bx9',
+        'md5': '5c4c4a8ca2281a199c8eefe8f411d630',
+        'info_dict': {
+            'id': 'm1chxrwq7bx9',
+            'ext': 'mp4',
+            'title': 'Watch Cadbury Dream Factory S01E04 HDTV x264 FiHTV mp4',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+        
+        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')
+        
+        return {
+            'id': video_id,
+            'title': title,
+            'url': video_url,
+            'ext': 'mp4',
+        }
+        
\ No newline at end of file