From: Sergey M․ Date: Mon, 27 Jun 2016 15:44:17 +0000 (+0700) Subject: [kaltura] Add _extract_url with fixed regex X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=9ea5c04c0d16f5519079ae04fdad62fc28c884b0;p=youtube-dl.git [kaltura] Add _extract_url with fixed regex --- diff --git a/youtube_dl/extractor/kaltura.py b/youtube_dl/extractor/kaltura.py index a65697ff5..c75a958ba 100644 --- a/youtube_dl/extractor/kaltura.py +++ b/youtube_dl/extractor/kaltura.py @@ -64,6 +64,32 @@ class KalturaIE(InfoExtractor): } ] + @staticmethod + def _extract_url(webpage): + mobj = ( + re.search( + r"""(?xs) + kWidget\.(?:thumb)?[Ee]mbed\( + \{.*? + (?P['\"])wid(?P=q1)\s*:\s* + (?P['\"])_?(?P[^'\"]+)(?P=q2),.*? + (?P['\"])entry_?[Ii]d(?P=q3)\s*:\s* + (?P['\"])(?P[^'\"]+)(?P=q4), + """, webpage) or + re.search( + r'''(?xs) + (?P["\']) + (?:https?:)?//cdnapi(?:sec)?\.kaltura\.com/.*?(?:p|partner_id)/(?P\d+).*? + (?P=q1).*? + (?: + entry_?[Ii]d| + (?P["\'])entry_?[Ii]d(?P=q2) + )\s*:\s* + (?P["\'])(?P.+?)(?P=q3) + ''', webpage)) + if mobj: + return 'kaltura:%(partner_id)s:%(id)s' % mobj.groupdict() + def _kaltura_api_call(self, video_id, actions, *args, **kwargs): params = actions[0] if len(actions) > 1: