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.

34 lines
1.1 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': '3sat',
  17. 'upload_date': '20140913'
  18. }
  19. },
  20. {
  21. 'url': 'http://www.3sat.de/mediathek/mediathek.php?mode=play&obj=51066',
  22. 'only_matching': True,
  23. },
  24. ]
  25. def _real_extract(self, url):
  26. mobj = re.match(self._VALID_URL, url)
  27. video_id = mobj.group('id')
  28. details_url = 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id=%s' % video_id
  29. return self.extract_from_xml_url(video_id, details_url)