diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:10:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:10:22 +0000 |
commit | bb3682b5a9a4d0e8e45f74de8c21dba3d5e6e0ab (patch) | |
tree | d7890656a89a7d2f3497a5793dd65aa746f7cabd /yt_dlp/extractor/dplay.py | |
parent | Adding upstream version 2024.04.09. (diff) | |
download | yt-dlp-upstream/2024.05.26.tar.xz yt-dlp-upstream/2024.05.26.zip |
Adding upstream version 2024.05.26.upstream/2024.05.26
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/dplay.py')
-rw-r--r-- | yt_dlp/extractor/dplay.py | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/yt_dlp/extractor/dplay.py b/yt_dlp/extractor/dplay.py index 363b4be..ddf2128 100644 --- a/yt_dlp/extractor/dplay.py +++ b/yt_dlp/extractor/dplay.py @@ -4,8 +4,8 @@ import uuid from .common import InfoExtractor from ..networking.exceptions import HTTPError from ..utils import ( - determine_ext, ExtractorError, + determine_ext, float_or_none, int_or_none, remove_start, @@ -355,12 +355,10 @@ class DiscoveryPlusBaseIE(DPlayBaseIE): video_id, headers=headers, data=json.dumps({ 'deviceInfo': { 'adBlocker': False, + 'drmSupported': False, }, 'videoId': video_id, - 'wisteriaProperties': { - 'platform': 'desktop', - 'product': self._PRODUCT, - }, + 'wisteriaProperties': {}, }).encode('utf-8'))['data']['attributes']['streaming'] def _real_extract(self, url): @@ -878,10 +876,31 @@ class DiscoveryPlusIndiaIE(DiscoveryPlusBaseIE): }) -class DiscoveryNetworksDeIE(DPlayBaseIE): +class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE): _VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de|dplay\.co\.uk)/(?:programme|show|sendungen)/(?P<programme>[^/]+)/(?:video/)?(?P<alternate_id>[^/]+)' _TESTS = [{ + 'url': 'https://dmax.de/sendungen/goldrausch-in-australien/german-gold', + 'info_dict': { + 'id': '4756322', + 'ext': 'mp4', + 'title': 'German Gold', + 'description': 'md5:f3073306553a8d9b40e6ac4cdbf09fc6', + 'display_id': 'goldrausch-in-australien/german-gold', + 'episode': 'Episode 1', + 'episode_number': 1, + 'season': 'Season 5', + 'season_number': 5, + 'series': 'Goldrausch in Australien', + 'duration': 2648.0, + 'upload_date': '20230517', + 'timestamp': 1684357500, + 'creators': ['DMAX'], + 'thumbnail': 'https://eu1-prod-images.disco-api.com/2023/05/09/f72fb510-7992-3b12-af7f-f16a2c22d1e3.jpeg', + 'tags': ['schatzsucher', 'schatz', 'nugget', 'bodenschätze', 'down under', 'australien', 'goldrausch'], + }, + 'params': {'skip_download': 'm3u8'}, + }, { 'url': 'https://www.tlc.de/programme/breaking-amish/video/die-welt-da-drauen/DCB331270001100', 'info_dict': { 'id': '78867', @@ -901,9 +920,7 @@ class DiscoveryNetworksDeIE(DPlayBaseIE): 'season_number': 1, 'thumbnail': r're:https://.+\.jpg', }, - 'params': { - 'skip_download': True, - }, + 'skip': '404 Not Found', }, { 'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316', 'only_matching': True, @@ -920,8 +937,14 @@ class DiscoveryNetworksDeIE(DPlayBaseIE): 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) + url, f'{programme}/{alternate_id}', 'eu1-prod.disco-api.com', realm, country) + + def _update_disco_api_headers(self, headers, disco_base, display_id, realm): + headers.update({ + 'x-disco-params': f'realm={realm}', + 'x-disco-client': 'Alps:HyogaPlayer:0.0.0', + 'Authorization': self._get_auth(disco_base, display_id, realm), + }) class DiscoveryPlusShowBaseIE(DPlayBaseIE): |