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