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.

51 lines
1.7 KiB

  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. class RtlXlIE(InfoExtractor):
  5. IE_NAME = 'rtlxl.nl'
  6. _VALID_URL = r'https?://www\.rtlxl\.nl/#!/[^/]+/(?P<uuid>[^/?]+)'
  7. _TEST = {
  8. 'url': 'http://www.rtlxl.nl/#!/rtl-nieuws-132237/6e4203a6-0a5e-3596-8424-c599a59e0677',
  9. 'info_dict': {
  10. 'id': '6e4203a6-0a5e-3596-8424-c599a59e0677',
  11. 'ext': 'flv',
  12. 'title': 'RTL Nieuws - Laat',
  13. 'description': 'Dagelijks het laatste nieuws uit binnen- en '
  14. 'buitenland. Voor nog meer nieuws kunt u ook gebruikmaken van '
  15. 'onze mobiele apps.',
  16. 'timestamp': 1408051800,
  17. 'upload_date': '20140814',
  18. },
  19. 'params': {
  20. # We download the first bytes of the first fragment, it can't be
  21. # processed by the f4m downloader beacuse it isn't complete
  22. 'skip_download': True,
  23. },
  24. }
  25. def _real_extract(self, url):
  26. mobj = re.match(self._VALID_URL, url)
  27. uuid = mobj.group('uuid')
  28. info = self._download_json(
  29. 'http://www.rtl.nl/system/s4m/vfd/version=2/uuid=%s/fmt=flash/' % uuid,
  30. uuid)
  31. material = info['material'][0]
  32. episode_info = info['episodes'][0]
  33. f4m_url = 'http://manifest.us.rtl.nl' + material['videopath']
  34. progname = info['abstracts'][0]['name']
  35. subtitle = material['title'] or info['episodes'][0]['name']
  36. return {
  37. 'id': uuid,
  38. 'title': '%s - %s' % (progname, subtitle),
  39. 'formats': self._extract_f4m_formats(f4m_url, uuid),
  40. 'timestamp': material['original_date'],
  41. 'description': episode_info['synopsis'],
  42. }