]> asedeno.scripts.mit.edu Git - youtube-dl.git/blob - youtube_dl/extractor/kth.py
b8db461f55a7f81194beeea96b865f6ef58cda37
[youtube-dl.git] / youtube_dl / extractor / kth.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 from .common import InfoExtractor
5 from ..utils import smuggle_url
6
7
8 class KTHIE(InfoExtractor):
9     _VALID_URL = r'https?://play\.kth\.se/(?:[^/]+/)+(?P<id>[a-z0-9_]+)'
10     _TEST = {
11         'url': 'https://play.kth.se/media/Lunch+breakA+De+nya+aff%C3%A4rerna+inom+Fordonsdalen/0_uoop6oz9',
12         'md5': 'd83ada6d00ca98b73243a88efe19e8a6',
13         'info_dict': {
14             'id': '0_uoop6oz9',
15             'ext': 'mp4',
16             'title': 'md5:bd1d6931facb6828762a33e6ce865f37',
17             'thumbnail': 're:https?://.+/thumbnail/.+',
18             'duration': 3516,
19             'timestamp': 1647345358,
20             'upload_date': '20220315',
21             'uploader_id': 'md5:0ec23e33a89e795a4512930c8102509f',
22         }
23     }
24
25     def _real_extract(self, url):
26         video_id = self._match_id(url)
27         result = self.url_result(
28             smuggle_url('kaltura:308:%s' % video_id, {
29                 'service_url': 'https://api.kaltura.nordu.net'}),
30             'Kaltura')
31         return result