]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[godtv] Add extractor
authorTRox1972 <TRox1972@users.noreply.github.com>
Fri, 27 May 2016 11:37:40 +0000 (13:37 +0200)
committerSergey M․ <dstftw@gmail.com>
Thu, 9 Jun 2016 14:27:27 +0000 (21:27 +0700)
[GodTV] Improvements

youtube_dl/extractor/extractors.py
youtube_dl/extractor/godtv.py [new file with mode: 0644]

index aa98782a5097c348a23a3387dbdce08884f813e4..40dcfcde33e0f92a8122ec680730aabe11875319 100644 (file)
@@ -292,6 +292,7 @@ from .globo import (
     GloboArticleIE,
 )
 from .godtube import GodTubeIE
+from .godtv import GodTVIE
 from .goldenmoustache import GoldenMoustacheIE
 from .golem import GolemIE
 from .googledrive import GoogleDriveIE
diff --git a/youtube_dl/extractor/godtv.py b/youtube_dl/extractor/godtv.py
new file mode 100644 (file)
index 0000000..50f093a
--- /dev/null
@@ -0,0 +1,29 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from .ooyala import OoyalaIE
+
+
+class GodTVIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?god\.tv(?:/[^/]+)+/(?P<id>[^/?#&]+)'
+    _TEST = {
+        'url': 'http://god.tv/jesus-image/video/jesus-conference-2016/randy-needham',
+        'info_dict': {
+            'id': 'lpd3g2MzE6D1g8zFAKz8AGpxWcpu6o_3',
+            'ext': 'mp4',
+            'title': 'Randy Needham',
+            'duration': 3615.08,
+        },
+        'params': {
+            'skip_download': True,
+        }
+    }
+
+    def _real_extract(self, url):
+        display_id = self._match_id(url)
+
+        webpage = self._download_webpage(url, display_id)
+        ooyala_id = self._search_regex(r'"content_id"\s*:\s*"([\w-]{32})"', webpage, display_id)
+
+        return OoyalaIE._build_url_result(ooyala_id)