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.

35 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..utils import remove_end
  5. class TelegraafIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?telegraaf\.nl/tv/(?:[^/]+/)+(?P<id>\d+)/[^/]+\.html'
  7. _TEST = {
  8. 'url': 'http://www.telegraaf.nl/tv/nieuws/binnenland/24353229/__Tikibad_ontruimd_wegens_brand__.html',
  9. 'md5': '83245a9779bcc4a24454bfd53c65b6dc',
  10. 'info_dict': {
  11. 'id': '24353229',
  12. 'ext': 'mp4',
  13. 'title': 'Tikibad ontruimd wegens brand',
  14. 'description': 'md5:05ca046ff47b931f9b04855015e163a4',
  15. 'thumbnail': 're:^https?://.*\.jpg$',
  16. 'duration': 33,
  17. },
  18. }
  19. def _real_extract(self, url):
  20. playlist_id = self._match_id(url)
  21. webpage = self._download_webpage(url, playlist_id)
  22. playlist_url = self._search_regex(
  23. r"iframe\.loadPlayer\('([^']+)'", webpage, 'player')
  24. entries = self._extract_xspf_playlist(playlist_url, playlist_id)
  25. title = remove_end(self._og_search_title(webpage), ' - VIDEO')
  26. description = self._og_search_description(webpage)
  27. return self.playlist_result(entries, playlist_id, title, description)