1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2026-04-27 01:03:28 +00:00
Files
youtube-dl/youtube_dl/extractor/restudy.py
T

45 lines
1.3 KiB
Python
Raw Normal View History

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