[generic] Add support for tube8 embeds
authorSergey M․ <dstftw@gmail.com>
Sun, 8 Apr 2018 17:37:15 +0000 (00:37 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 8 Apr 2018 17:37:15 +0000 (00:37 +0700)
youtube_dl/extractor/generic.py
youtube_dl/extractor/tube8.py

index 8922d19142659d2b20df412e462d19715ff5d4d8..e3cb5c5ce51de5d5fc4aac16c64443b60e91b478 100644 (file)
@@ -58,6 +58,7 @@ from .xhamster import XHamsterEmbedIE
 from .tnaflix import TNAFlixNetworkEmbedIE
 from .drtuber import DrTuberIE
 from .redtube import RedTubeIE
+from .tube8 import Tube8IE
 from .vimeo import VimeoIE
 from .dailymotion import DailymotionIE
 from .dailymail import DailyMailIE
@@ -2556,6 +2557,11 @@ class GenericIE(InfoExtractor):
         if redtube_urls:
             return self.playlist_from_matches(redtube_urls, video_id, video_title, ie=RedTubeIE.ie_key())
 
+        # Look for embedded Tube8 player
+        tube8_urls = Tube8IE._extract_urls(webpage)
+        if tube8_urls:
+            return self.playlist_from_matches(tube8_urls, video_id, video_title, ie=Tube8IE.ie_key())
+
         # Look for embedded Tvigle player
         mobj = re.search(
             r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1', webpage)
index 1853a1104c2b8957793ede25c6296598eb0babc9..368c45729af533eca244f4d0e8a29bfe5f4f7a8a 100644 (file)
@@ -31,6 +31,12 @@ class Tube8IE(KeezMoviesIE):
         'only_matching': True,
     }]
 
+    @staticmethod
+    def _extract_urls(webpage):
+        return re.findall(
+            r'<iframe[^>]+\bsrc=["\']((?:https?:)?//(?:www\.)?tube8\.com/embed/(?:[^/]+/)+\d+)',
+            webpage)
+
     def _real_extract(self, url):
         webpage, info = self._extract_info(url)