Repository: yt-dlp/yt-dlp

Issue:
[Discoveryplus] Some regions give "This video is only available for registered users"
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2021.12.27**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Italy

### Description

These urls:
https://www.discoveryplus.it/video/dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1
https://www.discoveryplus.it/video/dal-pollaio-alla-pista/stagione-2-episodio-8-fiat-x19-silhouette-parte-1
work with a browser and not with yt-dlp.
This https://www.discoveryplus.it/video/dal-pollaio-alla-pista/stagione-2-episodio-7-ford-escort-mk1-parte-2 works.

### Verbose log

```shell
[debug] Command-line config: ['--no-config', '-v', 'https://www.discoveryplus.it/video/dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, err UTF-8, pref UTF-8
[debug] yt-dlp version 2021.12.25 [87e0499]
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Python version 3.7.3 (CPython 64bit) - Linux-4.19.0-18-amd64-x86_64-with-debian-10.11
[debug] exe versions: ffmpeg 4.1.8-0, ffprobe 4.1.8-0, phantomjs ., rtmpdump 2.4
[debug] Optional libraries: Crypto, keyring, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [DPlay] Extracting URL: https://www.discoveryplus.it/video/dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1
[debug] Using fake IP 79.30.156.88 (IT) as X-Forwarded-For
[DPlay] dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1: Downloading token
[DPlay] dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1: Downloading JSON metadata
[DPlay] 130662: Downloading JSON metadata
ERROR: [DPlay] dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1: This video is only available for registered users. You may want to use --cookies.
File "/opt/yt-dlp/yt_dlp/extractor/common.py", line 599, in extract
ie_result = self._real_extract(url)
File "/opt/yt-dlp/yt_dlp/extractor/dplay.py", line 321, in _real_extract
url, display_id, host, 'dplay' + country, country, domain)
File "/opt/yt-dlp/yt_dlp/extractor/dplay.py", line 104, in _get_disco_api_info
self._process_errors(e, geo_countries)
File "/opt/yt-dlp/yt_dlp/extractor/dplay.py", line 51, in _process_errors
'This video is only available for registered users. You may want to use --cookies.', expected=True)

[debug] Command-line config: ['-no-geo-bypass', '--no-config', '-v', '--cookies', 'discoveryplus.com_cookies.txt', 'https://www.discoveryplus.com/it/video/dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, err UTF-8, pref UTF-8
[debug] yt-dlp version 2021.12.25 [87e049962]
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Python version 3.7.3 (CPython 64bit) - Linux-4.19.0-18-amd64-x86_64-with-debian-10.11
[debug] exe versions: ffmpeg 4.1.8-0, ffprobe 4.1.8-0, phantomjs ., rtmpdump 2.4
[debug] Optional libraries: Crypto, secretstorage, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [DiscoveryPlusItaly] Extracting URL: https://www.discoveryplus.com/it/video/dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1
[debug] [DPlay] Extracting URL: https://discoveryplus.it/video/dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1
[debug] Using fake IP 79.16.98.210 (IT) as X-Forwarded-For
[DPlay] dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1: Downloading JSON metadata
[DPlay] 130662: Downloading JSON metadata
ERROR: [DPlay] dal-pollaio-alla-pista/stagione-2-episodio-6-ford-escort-mk1-parte-1: This video is only available for registered users. You may want to use --cookies.
  File "/opt/yt-dlp/yt_dlp/extractor/common.py", line 599, in extract
    ie_result = self._real_extract(url)
  File "/opt/yt-dlp/yt_dlp/extractor/dplay.py", line 321, in _real_extract
    url, display_id, host, 'dplay' + country, country, domain)
  File "/opt/yt-dlp/yt_dlp/extractor/dplay.py", line 104, in _get_disco_api_info
    self._process_errors(e, geo_countries)
  File "/opt/yt-dlp/yt_dlp/extractor/dplay.py", line 51, in _process_errors
    'This video is only available for registered users. You may want to use --cookies.', expected=True)
```



Discussion:
same here, Brazil

Resolving patch:
diff --git a/yt_dlp/extractor/dplay.py b/yt_dlp/extractor/dplay.py
--- a/yt_dlp/extractor/dplay.py
+++ b/yt_dlp/extractor/dplay.py
@@ -575,16 +575,19 @@ def _real_extract(self, url):
         return self.playlist_result(self._entries(show_name), playlist_id=show_name)
 
 
-class DiscoveryPlusItalyIE(InfoExtractor):
+class DiscoveryPlusItalyIE(DiscoveryPlusIE):
     _VALID_URL = r'https?://(?:www\.)?discoveryplus\.com/it/video' + DPlayBaseIE._PATH_REGEX
     _TESTS = [{
         'url': 'https://www.discoveryplus.com/it/video/i-signori-della-neve/stagione-2-episodio-1-i-preparativi',
         'only_matching': True,
     }]
 
+    _API_URL = 'eu1-prod-direct.discoveryplus.com'
+
     def _real_extract(self, url):
-        video_id = self._match_id(url)
-        return self.url_result(f'https://discoveryplus.it/video/{video_id}', DPlayIE.ie_key(), video_id)
+        display_id = self._match_id(url)
+        return self._get_disco_api_info(
+            url, display_id, self._API_URL, 'dplay', 'it')
 
 
 class DiscoveryPlusItalyShowIE(DiscoveryPlusShowBaseIE):


Test patch: