2014-12-14 05:58:52 +09:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
|
|
|
class RestudyIE(InfoExtractor):
|
2018-01-21 01:25:06 +09:00
|
|
|
_VALID_URL = r'https?://(?:(?:www|portal)\.)?restudy\.dk/video/[^/]+/id/(?P<id>[0-9]+)'
|
|
|
|
_TESTS = [{
|
2014-12-14 05:58:52 +09:00
|
|
|
'url': 'https://www.restudy.dk/video/play/id/1637',
|
|
|
|
'info_dict': {
|
|
|
|
'id': '1637',
|
2014-12-14 06:41:00 +09:00
|
|
|
'ext': 'flv',
|
2014-12-14 05:58:52 +09:00
|
|
|
'title': 'Leiden-frosteffekt',
|
2014-12-14 06:41:00 +09:00
|
|
|
'description': 'Denne video er et eksperiment med flydende kvælstof.',
|
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
# rtmp download
|
|
|
|
'skip_download': True,
|
2014-12-14 05:58:52 +09:00
|
|
|
}
|
2018-01-21 01:25:06 +09:00
|
|
|
}, {
|
|
|
|
'url': 'https://portal.restudy.dk/video/leiden-frosteffekt/id/1637',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2014-12-14 05:58:52 +09:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
video_id = self._match_id(url)
|
2014-12-14 06:41:00 +09:00
|
|
|
|
2014-12-14 05:58:52 +09:00
|
|
|
webpage = self._download_webpage(url, video_id)
|
2014-12-14 06:41:00 +09:00
|
|
|
|
|
|
|
title = self._og_search_title(webpage).strip()
|
|
|
|
description = self._og_search_description(webpage).strip()
|
|
|
|
|
|
|
|
formats = self._extract_smil_formats(
|
2018-01-21 01:19:02 +09:00
|
|
|
'https://cdn.portal.restudy.dk/dynamic/themes/front/awsmedia/SmilDirectory/video_%s.xml' % video_id,
|
2014-12-14 06:41:00 +09:00
|
|
|
video_id)
|
2016-03-27 10:03:08 +09:00
|
|
|
self._sort_formats(formats)
|
2014-12-14 06:41:00 +09:00
|
|
|
|
2014-12-14 05:58:52 +09:00
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'title': title,
|
2014-12-14 06:41:00 +09:00
|
|
|
'description': description,
|
|
|
|
'formats': formats,
|
2014-12-14 05:58:52 +09:00
|
|
|
}
|