2 from __future__ import unicode_literals
4 from .common import InfoExtractor
7 class RestudyIE(InfoExtractor):
8 _VALID_URL = r'https://www.restudy.dk/video/play/id/(?P<id>[0-9]+)'
10 'url': 'https://www.restudy.dk/video/play/id/1637',
11 # MD5 sum of first 10241 bytes of the video file, as reported by
12 # head -c 10241 Leiden-frosteffekt-1637.mp4 | md5sum
13 'md5': '4e755c4287f292a1fe5363834a683818',
17 'title': 'Leiden-frosteffekt',
21 def _real_extract(self, url):
22 video_id = self._match_id(url)
23 webpage = self._download_webpage(url, video_id)
25 'https://www.restudy.dk/awsmedia/SmilDirectory/video_%s.xml'
27 xml = self._download_webpage(xml_url, video_id)
29 base = self._search_regex(
30 r'<meta base="([^"]+)', xml, 'meta base')
31 # TODO: Provide multiple video qualities instead of forcing highest
32 filename = self._search_regex(
33 r'<video src="mp4:([^"]+_high\.mp4)', xml, 'filename')
34 url = '%s%s' % (base, filename)
35 title = self._og_search_title(webpage)