aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/kaltura.py
diff options
context:
space:
mode:
authorJohn Hawkinson <jhawk@mit.edu>2017-04-08 05:40:57 -0400
committerSergey M <dstftw@gmail.com>2017-04-08 16:40:57 +0700
commita01825a5416174de56625a6ef202311e2d6c8cb1 (patch)
tree707748bafdcfbe6cdf6e961e0a8112ea274687f6 /youtube_dl/extractor/kaltura.py
parentf8f2da25ab83779f5a9521f327987d5e7bace85f (diff)
[kaltura] Add support for iframe embeds
Diffstat (limited to 'youtube_dl/extractor/kaltura.py')
-rw-r--r--youtube_dl/extractor/kaltura.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/youtube_dl/extractor/kaltura.py b/youtube_dl/extractor/kaltura.py
index 54374ea76..c6efdea93 100644
--- a/youtube_dl/extractor/kaltura.py
+++ b/youtube_dl/extractor/kaltura.py
@@ -91,6 +91,7 @@ class KalturaIE(InfoExtractor):
}],
},
},
+ 'skip': 'Gone. Maybe https://www.safaribooksonline.com/library/tutorials/introduction-to-python-anon/3469/',
'params': {
'skip_download': True,
},
@@ -108,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\(
@@ -127,7 +129,16 @@ class KalturaIE(InfoExtractor):
(?P<q2>["\'])entry_?[Ii]d(?P=q2)
)\s*:\s*
(?P<q3>["\'])(?P<id>(?:(?!(?P=q3)).)+)(?P=q3)
- ''', webpage))
+ ''', webpage) or
+ re.search(
+ r'''(?xs)
+ <iframe[^>]+src=(?P<q1>["\'])
+ (?:https?:)?//(?:www\.)?kaltura\.com/p/(?P<partner_id>\d+)/
+ (?:(?!(?P=q1)).)*
+ [\?&]entry_id=(?P<id>(?:(?!(?P=q1))[^&])+)
+ (?P=q1)
+ ''', webpage)
+ )
if mobj:
embed_info = mobj.groupdict()
url = 'kaltura:%(partner_id)s:%(id)s' % embed_info