2016-10-02 20:39:18 +09:00
|
|
|
# coding: utf-8
|
2014-04-16 22:45:05 +09:00
|
|
|
from __future__ import unicode_literals
|
2016-09-08 01:29:06 +09:00
|
|
|
|
2014-04-16 22:45:05 +09:00
|
|
|
import re
|
|
|
|
|
2018-06-14 00:46:59 +09:00
|
|
|
from .dplay import DPlayIE
|
2014-04-17 03:27:33 +09:00
|
|
|
|
|
|
|
|
2018-06-14 00:46:59 +09:00
|
|
|
class DiscoveryNetworksDeIE(DPlayIE):
|
2020-11-20 18:47:52 +09:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de|dplay\.co\.uk)/(?:programme|show|sendungen)/(?P<programme>[^/]+)/(?:video/)?(?P<alternate_id>[^/]+)'
|
2014-04-16 22:45:05 +09:00
|
|
|
|
2017-03-17 17:53:44 +09:00
|
|
|
_TESTS = [{
|
2019-10-26 22:57:42 +09:00
|
|
|
'url': 'https://www.tlc.de/programme/breaking-amish/video/die-welt-da-drauen/DCB331270001100',
|
2014-04-16 22:45:05 +09:00
|
|
|
'info_dict': {
|
2019-10-26 22:57:42 +09:00
|
|
|
'id': '78867',
|
2014-04-16 22:45:05 +09:00
|
|
|
'ext': 'mp4',
|
2019-10-26 22:57:42 +09:00
|
|
|
'title': 'Die Welt da draußen',
|
|
|
|
'description': 'md5:61033c12b73286e409d99a41742ef608',
|
|
|
|
'timestamp': 1554069600,
|
|
|
|
'upload_date': '20190331',
|
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
'format': 'bestvideo',
|
|
|
|
'skip_download': True,
|
2014-04-16 22:45:05 +09:00
|
|
|
},
|
2017-03-17 17:53:44 +09:00
|
|
|
}, {
|
2019-10-26 22:57:42 +09:00
|
|
|
'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316',
|
2017-03-17 17:53:44 +09:00
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
2019-10-26 22:57:42 +09:00
|
|
|
'url': 'https://www.dplay.co.uk/show/ghost-adventures/video/hotel-leger-103620/EHD_280313B',
|
2017-03-17 17:53:44 +09:00
|
|
|
'only_matching': True,
|
2020-11-20 18:47:52 +09:00
|
|
|
}, {
|
|
|
|
'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
|
|
|
|
'only_matching': True,
|
2017-03-17 17:53:44 +09:00
|
|
|
}]
|
2014-04-16 22:45:05 +09:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2019-10-26 22:57:42 +09:00
|
|
|
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)
|