aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2021-01-05 17:31:19 +0100
committerRemita Amine <remitamine@gmail.com>2021-01-05 17:31:58 +0100
commitbe1a3f2d11b9d88c10b624b12b00b508d923983d (patch)
treed00bd5b649c9630e379cc9e34129fd13fd751666
parentecae54a98d2a8d9300142bf3d586f31e8144ccd6 (diff)
downloadyoutube-dl-be1a3f2d11b9d88c10b624b12b00b508d923983d.tar.xz
[dplay] Add suport Discovery+ domains(closes #27680)
-rw-r--r--youtube_dl/extractor/dplay.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/youtube_dl/extractor/dplay.py b/youtube_dl/extractor/dplay.py
index a7b9db568..47501dbe6 100644
--- a/youtube_dl/extractor/dplay.py
+++ b/youtube_dl/extractor/dplay.py
@@ -17,7 +17,12 @@ from ..utils import (
class DPlayIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://
(?P<domain>
- (?:www\.)?(?P<host>dplay\.(?P<country>dk|fi|jp|se|no))|
+ (?:www\.)?(?P<host>d
+ (?:
+ play\.(?P<country>dk|fi|jp|se|no)|
+ iscoveryplus\.(?P<plus_country>dk|es|fi|it|se|no)
+ )
+ )|
(?P<subdomain_country>es|it)\.dplay\.com
)/[^/]+/(?P<id>[^/]+/[^/?#]+)'''
@@ -126,6 +131,24 @@ class DPlayIE(InfoExtractor):
}, {
'url': 'https://www.dplay.jp/video/gold-rush/24086',
'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.se/videos/nugammalt-77-handelser-som-format-sverige/nugammalt-77-handelser-som-format-sverige-101',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.dk/videoer/ted-bundy-mind-of-a-monster/ted-bundy-mind-of-a-monster',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.no/videoer/i-kongens-klr/sesong-1-episode-7',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.it/videos/biografie-imbarazzanti/luigi-di-maio-la-psicosi-di-stanislawskij',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.es/videos/la-fiebre-del-oro/temporada-8-episodio-1',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://www.discoveryplus.fi/videot/shifting-gears-with-aaron-kaufman/episode-16',
+ 'only_matching': True,
}]
def _get_disco_api_info(self, url, display_id, disco_host, realm, country):
@@ -241,7 +264,7 @@ class DPlayIE(InfoExtractor):
mobj = re.match(self._VALID_URL, url)
display_id = mobj.group('id')
domain = mobj.group('domain').lstrip('www.')
- country = mobj.group('country') or mobj.group('subdomain_country')
- host = 'disco-api.' + domain if domain.startswith('dplay.') else 'eu2-prod.disco-api.com'
+ country = mobj.group('country') or mobj.group('subdomain_country') or mobj.group('plus_country')
+ host = 'disco-api.' + domain if domain[0] == 'd' else 'eu2-prod.disco-api.com'
return self._get_disco_api_info(
url, display_id, host, 'dplay' + country, country)