aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/kaltura.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl/extractor/kaltura.py')
-rw-r--r--youtube_dl/extractor/kaltura.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/youtube_dl/extractor/kaltura.py b/youtube_dl/extractor/kaltura.py
index 49d13460d..2d38b758b 100644
--- a/youtube_dl/extractor/kaltura.py
+++ b/youtube_dl/extractor/kaltura.py
@@ -113,14 +113,9 @@ class KalturaIE(InfoExtractor):
@staticmethod
def _extract_url(webpage):
- urls = KalturaIE._extract_urls(webpage)
- return urls[0] if urls else None
-
- @staticmethod
- def _extract_urls(webpage):
# Embed codes: https://knowledge.kaltura.com/embedding-kaltura-media-players-your-site
- finditer = (
- re.finditer(
+ mobj = (
+ re.search(
r"""(?xs)
kWidget\.(?:thumb)?[Ee]mbed\(
\{.*?
@@ -129,7 +124,7 @@ class KalturaIE(InfoExtractor):
(?P<q3>['"])entry_?[Ii]d(?P=q3)\s*:\s*
(?P<q4>['"])(?P<id>(?:(?!(?P=q4)).)+)(?P=q4)(?:,|\s*\})
""", webpage)
- or re.finditer(
+ or re.search(
r'''(?xs)
(?P<q1>["'])
(?:https?:)?//cdnapi(?:sec)?\.kaltura\.com(?::\d+)?/(?:(?!(?P=q1)).)*\b(?:p|partner_id)/(?P<partner_id>\d+)(?:(?!(?P=q1)).)*
@@ -143,7 +138,7 @@ class KalturaIE(InfoExtractor):
)
(?P<q3>["'])(?P<id>(?:(?!(?P=q3)).)+)(?P=q3)
''', webpage)
- or re.finditer(
+ or re.search(
r'''(?xs)
<(?:iframe[^>]+src|meta[^>]+\bcontent)=(?P<q1>["'])
(?:https?:)?//(?:(?:www|cdnapi(?:sec)?)\.)?kaltura\.com/(?:(?!(?P=q1)).)*\b(?:p|partner_id)/(?P<partner_id>\d+)
@@ -153,8 +148,7 @@ class KalturaIE(InfoExtractor):
(?P=q1)
''', webpage)
)
- urls = []
- for mobj in finditer:
+ if mobj:
embed_info = mobj.groupdict()
for k, v in embed_info.items():
if v:
@@ -166,8 +160,7 @@ class KalturaIE(InfoExtractor):
webpage)
if service_mobj:
url = smuggle_url(url, {'service_url': service_mobj.group('id')})
- urls.append(url)
- return urls
+ return url
def _kaltura_api_call(self, video_id, actions, service_url=None, *args, **kwargs):
params = actions[0]