You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class RestudyIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?restudy\.dk/video/play/id/(?P<id>[0-9]+)'
  6. _TEST = {
  7. 'url': 'https://www.restudy.dk/video/play/id/1637',
  8. 'info_dict': {
  9. 'id': '1637',
  10. 'ext': 'flv',
  11. 'title': 'Leiden-frosteffekt',
  12. 'description': 'Denne video er et eksperiment med flydende kvælstof.',
  13. },
  14. 'params': {
  15. # rtmp download
  16. 'skip_download': True,
  17. }
  18. }
  19. def _real_extract(self, url):
  20. video_id = self._match_id(url)
  21. webpage = self._download_webpage(url, video_id)
  22. title = self._og_search_title(webpage).strip()
  23. description = self._og_search_description(webpage).strip()
  24. formats = self._extract_smil_formats(
  25. 'https://www.restudy.dk/awsmedia/SmilDirectory/video_%s.xml' % video_id,
  26. video_id)
  27. self._sort_formats(formats)
  28. return {
  29. 'id': video_id,
  30. 'title': title,
  31. 'description': description,
  32. 'formats': formats,
  33. }