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.

45 lines
1.5 KiB

  1. from __future__ import unicode_literals
  2. from .dreisat import DreiSatIE
  3. class PhoenixIE(DreiSatIE):
  4. IE_NAME = 'phoenix.de'
  5. _VALID_URL = r'''(?x)https?://(?:www\.)?phoenix\.de/content/
  6. (?:
  7. phoenix/die_sendungen/(?:[^/]+/)?
  8. )?
  9. (?P<id>[0-9]+)'''
  10. _TESTS = [
  11. {
  12. 'url': 'http://www.phoenix.de/content/884301',
  13. 'md5': 'ed249f045256150c92e72dbb70eadec6',
  14. 'info_dict': {
  15. 'id': '884301',
  16. 'ext': 'mp4',
  17. 'title': 'Michael Krons mit Hans-Werner Sinn',
  18. 'description': 'Im Dialog - Sa. 25.10.14, 00.00 - 00.35 Uhr',
  19. 'upload_date': '20141025',
  20. 'uploader': 'Im Dialog',
  21. }
  22. },
  23. {
  24. 'url': 'http://www.phoenix.de/content/phoenix/die_sendungen/869815',
  25. 'only_matching': True,
  26. },
  27. {
  28. 'url': 'http://www.phoenix.de/content/phoenix/die_sendungen/diskussionen/928234',
  29. 'only_matching': True,
  30. },
  31. ]
  32. def _real_extract(self, url):
  33. video_id = self._match_id(url)
  34. webpage = self._download_webpage(url, video_id)
  35. internal_id = self._search_regex(
  36. r'<div class="phx_vod" id="phx_vod_([0-9]+)"',
  37. webpage, 'internal video ID')
  38. api_url = 'http://www.phoenix.de/php/mediaplayer/data/beitrags_details.php?ak=web&id=%s' % internal_id
  39. return self.extract_from_xml_url(video_id, api_url)