1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-24 11:32:51 +08:00

[Kaltura] comment; anchor RE to 'iframe'

Remove the example of an iframe spec from the spec page, and instead
link to it. Do so at the top of the method as it documents the
prviously two re.search()s as well.

Limit the iframe search to urls that actually appear in an <iframe
src="...  rather than inside any quoted string.
This commit is contained in:
John Hawkinson 2017-04-08 05:33:25 -04:00
parent 4905e589d7
commit a8df272cab

View File

@ -109,6 +109,7 @@ class KalturaIE(InfoExtractor):
@staticmethod
def _extract_url(webpage):
mobj = (
# Embed codes: https://knowledge.kaltura.com/embedding-kaltura-media-players-your-site
re.search(
r"""(?xs)
kWidget\.(?:thumb)?[Ee]mbed\(
@ -130,9 +131,8 @@ class KalturaIE(InfoExtractor):
(?P<q3>["\'])(?P<id>(?:(?!(?P=q3)).)+)(?P=q3)
''', webpage) or
re.search(
# <iframe src="http://www.kaltura.com/p/{PARTNER_ID}/sp/{PARTNER_ID}00/embedIframeJs/uiconf_id/{UICONF_ID}/partner_id/{PARTNER_ID}?iframeembed=true&playerId={UNIQUE_OBJ_ID}&entry_id={ENTRY_ID}" width="400" height="330" allowfullscreen webkitallowfullscreen mozAllowFullScreen frameborder="0"></iframe>
r'''(?xs)
(?P<q1>["\'])
<iframe[^>]+src=(?P<q1>["\'])
(?:https?:)?//(?:www\.)?kaltura\.com/p/(?P<partner_id>\d+)/
(?:(?!(?P=q1)).)*
[\?&]entry_id=(?P<id>(?:(?!(?P=q1))[^&])+)