[generic] Add support for tube8 embeds

This commit is contained in:
Sergey M․ 2018-04-09 00:37:15 +07:00
parent d3431dcb90
commit 069937151e
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
2 changed files with 12 additions and 0 deletions

View file

@ -58,6 +58,7 @@
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 @@ def _real_extract(self, url):
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)

View 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)