]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[extractor/generic] Add support for drtuber embds (closes #11098)
authorSergey M․ <dstftw@gmail.com>
Sun, 6 Nov 2016 14:33:51 +0000 (21:33 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 6 Nov 2016 14:33:51 +0000 (21:33 +0700)
youtube_dl/extractor/drtuber.py
youtube_dl/extractor/generic.py

index 95ecef66071bc11a9dd2829fe8dff91468851d0d..22da8e48105e5e8ee81a9cc948c67f6ec7d72eb8 100644 (file)
@@ -30,6 +30,12 @@ class DrTuberIE(InfoExtractor):
         'only_matching': True,
     }]
 
+    @staticmethod
+    def _extract_urls(webpage):
+        return re.findall(
+            r'<iframe[^>]+?src=["\'](?P<url>(?:https?:)?//(?:www\.)?drtuber\.com/embed/\d+)',
+            webpage)
+
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
index a0a45dce0589e7654fdfcd14bff9b7d5c0688a57..5c2782754369116af56a49de8f2cd11715ee6113 100644 (file)
@@ -47,6 +47,7 @@ from .svt import SVTIE
 from .pornhub import PornHubIE
 from .xhamster import XHamsterEmbedIE
 from .tnaflix import TNAFlixNetworkEmbedIE
+from .drtuber import DrTuberIE
 from .vimeo import VimeoIE
 from .dailymotion import (
     DailymotionIE,
@@ -1996,6 +1997,11 @@ class GenericIE(InfoExtractor):
         if tnaflix_urls:
             return _playlist_from_matches(tnaflix_urls, ie=TNAFlixNetworkEmbedIE.ie_key())
 
+        # Look for embedded DrTuber player
+        drtuber_urls = DrTuberIE._extract_urls(webpage)
+        if drtuber_urls:
+            return _playlist_from_matches(drtuber_urls, ie=DrTuberIE.ie_key())
+
         # Look for embedded Tvigle player
         mobj = re.search(
             r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1', webpage)