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.

38 lines
1.3 KiB

  1. from __future__ import unicode_literals
  2. import re
  3. from .zdf import ZDFIE
  4. class DreiSatIE(ZDFIE):
  5. IE_NAME = '3sat'
  6. _VALID_URL = r'(?:https?://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$'
  7. _TESTS = [
  8. {
  9. 'url': 'http://www.3sat.de/mediathek/index.php?mode=play&obj=45918',
  10. 'md5': 'be37228896d30a88f315b638900a026e',
  11. 'info_dict': {
  12. 'id': '45918',
  13. 'ext': 'mp4',
  14. 'title': 'Waidmannsheil',
  15. 'description': 'md5:cce00ca1d70e21425e72c86a98a56817',
  16. 'uploader': 'SCHWEIZWEIT',
  17. 'uploader_id': '100000210',
  18. 'upload_date': '20140913'
  19. },
  20. 'params': {
  21. 'skip_download': True, # m3u8 downloads
  22. }
  23. },
  24. {
  25. 'url': 'http://www.3sat.de/mediathek/mediathek.php?mode=play&obj=51066',
  26. 'only_matching': True,
  27. },
  28. ]
  29. def _real_extract(self, url):
  30. mobj = re.match(self._VALID_URL, url)
  31. video_id = mobj.group('id')
  32. details_url = 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id=%s' % video_id
  33. return self.extract_from_xml_url(video_id, details_url)