mirror of https://github.com/blackjack4494/yt-dlc
You cannot 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.6 KiB
Python
44 lines
1.6 KiB
Python
8 years ago
|
# coding: utf-8
|
||
11 years ago
|
from __future__ import unicode_literals
|
||
8 years ago
|
|
||
11 years ago
|
import re
|
||
|
|
||
7 years ago
|
from .dplay import DPlayIE
|
||
11 years ago
|
|
||
|
|
||
7 years ago
|
class DiscoveryNetworksDeIE(DPlayIE):
|
||
4 years ago
|
_VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de|dplay\.co\.uk)/(?:programme|show|sendungen)/(?P<programme>[^/]+)/(?:video/)?(?P<alternate_id>[^/]+)'
|
||
11 years ago
|
|
||
8 years ago
|
_TESTS = [{
|
||
5 years ago
|
'url': 'https://www.tlc.de/programme/breaking-amish/video/die-welt-da-drauen/DCB331270001100',
|
||
11 years ago
|
'info_dict': {
|
||
5 years ago
|
'id': '78867',
|
||
11 years ago
|
'ext': 'mp4',
|
||
5 years ago
|
'title': 'Die Welt da draußen',
|
||
|
'description': 'md5:61033c12b73286e409d99a41742ef608',
|
||
|
'timestamp': 1554069600,
|
||
|
'upload_date': '20190331',
|
||
|
},
|
||
|
'params': {
|
||
|
'format': 'bestvideo',
|
||
|
'skip_download': True,
|
||
11 years ago
|
},
|
||
8 years ago
|
}, {
|
||
5 years ago
|
'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316',
|
||
8 years ago
|
'only_matching': True,
|
||
|
}, {
|
||
5 years ago
|
'url': 'https://www.dplay.co.uk/show/ghost-adventures/video/hotel-leger-103620/EHD_280313B',
|
||
8 years ago
|
'only_matching': True,
|
||
4 years ago
|
}, {
|
||
|
'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
|
||
|
'only_matching': True,
|
||
8 years ago
|
}]
|
||
11 years ago
|
|
||
|
def _real_extract(self, url):
|
||
5 years ago
|
domain, programme, alternate_id = re.match(self._VALID_URL, url).groups()
|
||
|
country = 'GB' if domain == 'dplay.co.uk' else 'DE'
|
||
|
realm = 'questuk' if country == 'GB' else domain.replace('.', '')
|
||
|
return self._get_disco_api_info(
|
||
|
url, '%s/%s' % (programme, alternate_id),
|
||
|
'sonic-eu1-prod.disco-api.com', realm, country)
|