diff options
author | Aakash Gajjar <skyqutip@gmail.com> | 2020-08-26 20:22:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 20:22:32 +0530 |
commit | 19a107f21c7544b5e49a58040d09d9465f6858b1 (patch) | |
tree | 8325ffd206d9da1ce53f24b9ab4690abe175144d /youtube_dl/extractor/kaltura.py | |
parent | 7f7edf837c1af059f64a4968b942a83f86cf6206 (diff) | |
download | hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.tar.lz hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.tar.xz hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.zip |
Revert "pull changes from remote master (#190)" (#193)
This reverts commit b827ee921fe510a8730a9fab070148ed2b8279b5.
Diffstat (limited to 'youtube_dl/extractor/kaltura.py')
-rw-r--r-- | youtube_dl/extractor/kaltura.py | 19 |
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] |