aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimendum <timedum@gmail.com>2022-09-27 17:27:47 +0200
committerGitHub <noreply@github.com>2022-09-27 20:57:47 +0530
commit292fdad2970362743e8f0cf88cbd2d78edbc1fcd (patch)
treed53be5651ef65f7a3002dc08c6e7773304d26be6
parentc04cc2e28e2a6c2e3384fb203796714d739ae42a (diff)
downloadhypervideo-pre-292fdad2970362743e8f0cf88cbd2d78edbc1fcd.tar.lz
hypervideo-pre-292fdad2970362743e8f0cf88cbd2d78edbc1fcd.tar.xz
hypervideo-pre-292fdad2970362743e8f0cf88cbd2d78edbc1fcd.zip
[extractor/dplay:italy] Add default authentication (#5056)
Closes #2950 Authored by: Timendum
-rw-r--r--yt_dlp/extractor/dplay.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yt_dlp/extractor/dplay.py b/yt_dlp/extractor/dplay.py
index e16856b2b..e7629a5e1 100644
--- a/yt_dlp/extractor/dplay.py
+++ b/yt_dlp/extractor/dplay.py
@@ -907,6 +907,9 @@ class DiscoveryPlusItalyIE(DiscoveryPlusBaseIE):
_TESTS = [{
'url': 'https://www.discoveryplus.com/it/video/i-signori-della-neve/stagione-2-episodio-1-i-preparativi',
'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.com/it/video/super-benny/trailer',
+ 'only_matching': True,
}]
_PRODUCT = 'dplus_us'
@@ -916,6 +919,13 @@ class DiscoveryPlusItalyIE(DiscoveryPlusBaseIE):
'country': 'it',
}
+ def _update_disco_api_headers(self, headers, disco_base, display_id, realm):
+ headers.update({
+ 'x-disco-params': 'realm=%s' % realm,
+ 'x-disco-client': f'WEB:UNKNOWN:{self._PRODUCT}:25.2.6',
+ 'Authorization': self._get_auth(disco_base, display_id, realm),
+ })
+
class DiscoveryPlusItalyShowIE(DiscoveryPlusShowBaseIE):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.it/programmi/(?P<show_name>[^/]+)/?(?:[?#]|$)'