mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-15 22:05:39 +00:00
[openload] Improve embed detection
This commit is contained in:
parent
034f5fb5ee
commit
04988b55b5
1 changed files with 5 additions and 7 deletions
|
@ -243,18 +243,16 @@ class PhantomJSwrapper(object):
|
||||||
|
|
||||||
|
|
||||||
class OpenloadIE(InfoExtractor):
|
class OpenloadIE(InfoExtractor):
|
||||||
|
_DOMAINS = r'(?:openload\.(?:co|io|link|pw)|oload\.(?:tv|stream|site|xyz|win|download|cloud|cc|icu|fun|club|info|pw|live|space))'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
https?://
|
https?://
|
||||||
(?P<host>
|
(?P<host>
|
||||||
(?:www\.)?
|
(?:www\.)?
|
||||||
(?:
|
%s
|
||||||
openload\.(?:co|io|link|pw)|
|
|
||||||
oload\.(?:tv|stream|site|xyz|win|download|cloud|cc|icu|fun|club|info|pw|live|space)
|
|
||||||
)
|
|
||||||
)/
|
)/
|
||||||
(?:f|embed)/
|
(?:f|embed)/
|
||||||
(?P<id>[a-zA-Z0-9-_]+)
|
(?P<id>[a-zA-Z0-9-_]+)
|
||||||
'''
|
''' % _DOMAINS
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://openload.co/f/kUEfGclsU9o',
|
'url': 'https://openload.co/f/kUEfGclsU9o',
|
||||||
|
@ -359,8 +357,8 @@ class OpenloadIE(InfoExtractor):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_urls(webpage):
|
def _extract_urls(webpage):
|
||||||
return re.findall(
|
return re.findall(
|
||||||
r'<iframe[^>]+src=["\']((?:https?://)?(?:openload\.(?:co|io)|oload\.tv)/embed/[a-zA-Z0-9-_]+)',
|
r'<iframe[^>]+src=["\']((?:https?://)?%s/embed/[a-zA-Z0-9-_]+)'
|
||||||
webpage)
|
% OpenloadIE._DOMAINS, webpage)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
|
Loading…
Reference in a new issue