logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

discoverynetworks.py (1642B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. from .dplay import DPlayIE
  5. class DiscoveryNetworksDeIE(DPlayIE):
  6. _VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de|dplay\.co\.uk)/(?:programme|show|sendungen)/(?P<programme>[^/]+)/(?:video/)?(?P<alternate_id>[^/]+)'
  7. _TESTS = [{
  8. 'url': 'https://www.tlc.de/programme/breaking-amish/video/die-welt-da-drauen/DCB331270001100',
  9. 'info_dict': {
  10. 'id': '78867',
  11. 'ext': 'mp4',
  12. 'title': 'Die Welt da draußen',
  13. 'description': 'md5:61033c12b73286e409d99a41742ef608',
  14. 'timestamp': 1554069600,
  15. 'upload_date': '20190331',
  16. },
  17. 'params': {
  18. 'format': 'bestvideo',
  19. 'skip_download': True,
  20. },
  21. }, {
  22. 'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316',
  23. 'only_matching': True,
  24. }, {
  25. 'url': 'https://www.dplay.co.uk/show/ghost-adventures/video/hotel-leger-103620/EHD_280313B',
  26. 'only_matching': True,
  27. }, {
  28. 'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
  29. 'only_matching': True,
  30. }]
  31. def _real_extract(self, url):
  32. domain, programme, alternate_id = re.match(self._VALID_URL, url).groups()
  33. country = 'GB' if domain == 'dplay.co.uk' else 'DE'
  34. realm = 'questuk' if country == 'GB' else domain.replace('.', '')
  35. return self._get_disco_api_info(
  36. url, '%s/%s' % (programme, alternate_id),
  37. 'sonic-eu1-prod.disco-api.com', realm, country)