mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-24 19:22:06 +00:00
[jwplatform] Add support for multiple embeds (closes #15192)
This commit is contained in:
parent
0a5b1295b7
commit
b0ead0e09a
2 changed files with 10 additions and 7 deletions
|
@ -2708,9 +2708,9 @@ class GenericIE(InfoExtractor):
|
||||||
return self.url_result(viewlift_url)
|
return self.url_result(viewlift_url)
|
||||||
|
|
||||||
# Look for JWPlatform embeds
|
# Look for JWPlatform embeds
|
||||||
jwplatform_url = JWPlatformIE._extract_url(webpage)
|
jwplatform_urls = JWPlatformIE._extract_urls(webpage)
|
||||||
if jwplatform_url:
|
if jwplatform_urls:
|
||||||
return self.url_result(jwplatform_url, 'JWPlatform')
|
return self.playlist_from_matches(jwplatform_urls, video_id, video_title, ie=JWPlatformIE.ie_key())
|
||||||
|
|
||||||
# Look for Digiteka embeds
|
# Look for Digiteka embeds
|
||||||
digiteka_url = DigitekaIE._extract_url(webpage)
|
digiteka_url = DigitekaIE._extract_url(webpage)
|
||||||
|
|
|
@ -23,11 +23,14 @@ class JWPlatformIE(InfoExtractor):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_url(webpage):
|
def _extract_url(webpage):
|
||||||
mobj = re.search(
|
urls = JWPlatformIE._extract_urls(webpage)
|
||||||
r'<(?:script|iframe)[^>]+?src=["\'](?P<url>(?:https?:)?//content.jwplatform.com/players/[a-zA-Z0-9]{8})',
|
return urls[0] if urls else None
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _extract_urls(webpage):
|
||||||
|
return re.findall(
|
||||||
|
r'<(?:script|iframe)[^>]+?src=["\']((?:https?:)?//content\.jwplatform\.com/players/[a-zA-Z0-9]{8})',
|
||||||
webpage)
|
webpage)
|
||||||
if mobj:
|
|
||||||
return mobj.group('url')
|
|
||||||
|
|
||||||
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 a new issue