aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/kaltura.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-08-29 20:21:59 +0600
committerSergey M․ <dstftw@gmail.com>2015-08-29 20:21:59 +0600
commitee3ec091f46bd52979274d0aa42ff1f1c3344de6 (patch)
tree07715026df75c58f2dbc9e2a73e583bd4048aae9 /youtube_dl/extractor/kaltura.py
parentef49b5905345255bc6913e279b9d76a0bb83e1ce (diff)
[kaltura] Strictify _VALID_URL
Diffstat (limited to 'youtube_dl/extractor/kaltura.py')
-rw-r--r--youtube_dl/extractor/kaltura.py32
1 files changed, 22 insertions, 10 deletions
diff --git a/youtube_dl/extractor/kaltura.py b/youtube_dl/extractor/kaltura.py
index 1f64df4d5..c57f33ece 100644
--- a/youtube_dl/extractor/kaltura.py
+++ b/youtube_dl/extractor/kaltura.py
@@ -13,13 +13,25 @@ from ..utils import (
class KalturaIE(InfoExtractor):
_VALID_URL = r'''(?x)
- (?:kaltura:|
- https?://(:?(?:www|cdnapisec)\.)?kaltura\.com/(?:
- (?:index\.php/kwidget/(?:[^/]+/)*?wid/_)|
- (?:html5/html5lib/v(?:[\d.]+)/mwEmbedFrame.php/p/\d+)
- )
- )(?P<partner_id>\d+)?(?::|/(?:[^/]+/)*?entry_id/)(?P<id>[0-9a-z_]+)
- (?:\?wid=_(?P<partner_id_html5>\d+))?'''
+ (?:
+ kaltura:(?P<partner_id_s>\d+):(?P<id_s>[0-9a-z_]+)|
+ https?://
+ (:?
+ (?:www|cdnapisec)\.)?kaltura\.com/
+ (?:
+ (?:
+ # flash player
+ index\.php/kwidget/
+ (?:[^/]+/)*?wid/_(?P<partner_id>\d+)/
+ (?:[^/]+/)*?entry_id/(?P<id>[0-9a-z_]+)|
+ # html player
+ html5/html5lib/
+ (?:[^/]+/)*?entry_id/(?P<id_html5>[0-9a-z_]+)
+ .*\?.*\bwid=_(?P<partner_id_html5>\d+)
+ )
+ )
+ )
+ '''
_API_BASE = 'http://cdnapi.kaltura.com/api_v3/index.php?'
_TESTS = [
{
@@ -110,9 +122,9 @@ class KalturaIE(InfoExtractor):
video_id, actions, note='Downloading video info JSON')
def _real_extract(self, url):
- video_id = self._match_id(url)
mobj = re.match(self._VALID_URL, url)
- partner_id, entry_id = mobj.group('partner_id') or mobj.group('partner_id_html5'), mobj.group('id')
+ partner_id = mobj.group('partner_id_s') or mobj.group('partner_id') or mobj.group('partner_id_html5')
+ entry_id = mobj.group('id_s') or mobj.group('id') or mobj.group('id_html5')
info, source_data = self._get_video_info(entry_id, partner_id)
@@ -131,7 +143,7 @@ class KalturaIE(InfoExtractor):
self._sort_formats(formats)
return {
- 'id': video_id,
+ 'id': entry_id,
'title': info['name'],
'formats': formats,
'description': info.get('description'),