mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-11-16 18:42:38 +09:00
[generic] Add support for xhamster embeds
This commit is contained in:
parent
0bbba43ed0
commit
2bb5b6d0a1
@ -43,6 +43,7 @@ from .senateisvp import SenateISVPIE
|
|||||||
from .bliptv import BlipTVIE
|
from .bliptv import BlipTVIE
|
||||||
from .svt import SVTIE
|
from .svt import SVTIE
|
||||||
from .pornhub import PornHubIE
|
from .pornhub import PornHubIE
|
||||||
|
from .xhamster import XHamsterEmbedIE
|
||||||
from .vimeo import VimeoIE
|
from .vimeo import VimeoIE
|
||||||
from .dailymotion import DailymotionCloudIE
|
from .dailymotion import DailymotionCloudIE
|
||||||
|
|
||||||
@ -1331,6 +1332,11 @@ class GenericIE(InfoExtractor):
|
|||||||
if pornhub_url:
|
if pornhub_url:
|
||||||
return self.url_result(pornhub_url, 'PornHub')
|
return self.url_result(pornhub_url, 'PornHub')
|
||||||
|
|
||||||
|
# Look for embedded XHamster player
|
||||||
|
xhamster_urls = XHamsterEmbedIE._extract_urls(webpage)
|
||||||
|
if xhamster_urls:
|
||||||
|
return _playlist_from_matches(xhamster_urls, ie='XHamsterEmbed')
|
||||||
|
|
||||||
# Look for embedded Tvigle player
|
# Look for embedded Tvigle player
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1', webpage)
|
r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//cloud\.tvigle\.ru/video/.+?)\1', webpage)
|
||||||
|
@ -149,6 +149,12 @@ class XHamsterEmbedIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _extract_urls(webpage):
|
||||||
|
return [url for _, url in re.findall(
|
||||||
|
r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?xhamster\.com/xembed\.php\?video=\d+)\1',
|
||||||
|
webpage)]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user