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.

44 lines
1.4 KiB

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