[extractor/dplay:italy] Add default authentication (#5056)

Closes #2950

Authored by: Timendum
This commit is contained in:
Timendum 2022-09-27 17:27:47 +02:00 committed by GitHub
parent c04cc2e28e
commit 292fdad297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -907,6 +907,9 @@ class DiscoveryPlusItalyIE(DiscoveryPlusBaseIE):
_TESTS = [{ _TESTS = [{
'url': 'https://www.discoveryplus.com/it/video/i-signori-della-neve/stagione-2-episodio-1-i-preparativi', 'url': 'https://www.discoveryplus.com/it/video/i-signori-della-neve/stagione-2-episodio-1-i-preparativi',
'only_matching': True, 'only_matching': True,
}, {
'url': 'https://www.discoveryplus.com/it/video/super-benny/trailer',
'only_matching': True,
}] }]
_PRODUCT = 'dplus_us' _PRODUCT = 'dplus_us'
@ -916,6 +919,13 @@ class DiscoveryPlusItalyIE(DiscoveryPlusBaseIE):
'country': 'it', '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): class DiscoveryPlusItalyShowIE(DiscoveryPlusShowBaseIE):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.it/programmi/(?P<show_name>[^/]+)/?(?:[?#]|$)' _VALID_URL = r'https?://(?:www\.)?discoveryplus\.it/programmi/(?P<show_name>[^/]+)/?(?:[?#]|$)'