diff options
author | Sergey M․ <[email protected]> | 2016-11-06 21:33:51 +0700 |
---|---|---|
committer | Sergey M․ <[email protected]> | 2016-11-06 21:33:51 +0700 |
commit | 37e7a71c6c777635c4ed02339339ff27ccb04f58 (patch) | |
tree | c3d81a32023023fd449781c665ce14d5768cf922 | |
parent | f5c4b06f17ad8d2a17a3bdf84d8cb2f18b575b8e (diff) | |
download | youtube-dl-37e7a71c6c777635c4ed02339339ff27ccb04f58.tar.gz youtube-dl-37e7a71c6c777635c4ed02339339ff27ccb04f58.zip |
[extractor/generic] Add support for drtuber embds (closes #11098)
-rw-r--r-- | youtube_dl/extractor/drtuber.py | 6 | ||||
-rw-r--r-- | youtube_dl/extractor/generic.py | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/youtube_dl/extractor/drtuber.py b/youtube_dl/extractor/drtuber.py index 95ecef660..22da8e481 100644 --- a/youtube_dl/extractor/drtuber.py +++ b/youtube_dl/extractor/drtuber.py @@ -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') diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index a0a45dce0..5c2782754 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -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) |