Repository: yt-dlp/yt-dlp

Issue:
discovery italy gives error HTTPError 404: 'Not Found'
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.02.04**. ([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

Hello, when trying to download file info from https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022 i got this annoying error, just at the -F

Unable to download JSON metadata: HTTP Error 404: Not Found

thanks in advance!!

### Verbose log

```shell
C:\Users\Fede\Desktop\youtube_dl>yt-dlp.exe --verbose -F "https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022"
[debug] Command-line config: ['--verbose', '-F', 'https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2021.12.25 [87e0499] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19042-SP0
[debug] exe versions: ffmpeg 2021-12-23-git-60ead5cd68-essentials_build-www.gyan.dev (setts), ffprobe 2021-12-23-git-60ead5cd68-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [DiscoveryPlusItaly] Extracting URL: https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022
[debug] [DPlay] Extracting URL: https://discoveryplus.it/video/fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022
[debug] Using fake IP 79.48.245.10 (IT) as X-Forwarded-For
[DPlay] fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022: Downloading token
[DPlay] fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022: Downloading JSON metadata
ERROR: [DPlay] fratelli-di-crozza/stagione-6-puntata-1-del-18-febbraio-2022: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; type  yt-dlp -U  to update. Be sure to call yt-dlp with the --verbose flag and include its complete output. (caused by <HTTPError 404: 'Not Found'>); please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; type  yt-dlp -U  to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
  File "yt_dlp\extractor\common.py", line 717, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 3456, in urlopen
  File "urllib\request.py", line 531, in open
  File "urllib\request.py", line 640, in http_response
  File "urllib\request.py", line 569, in error
  File "urllib\request.py", line 502, in _call_chain
  File "urllib\request.py", line 649, in http_error_default
```



Discussion:
Possible duplicate of #2361, #2317
Hi I was also trying to download the same file and after a few attempts, I managed. The command that worked is below, all other attempts failed. Especially with different settings for the geographic options. Using `--no-geo-bypass` or `--geo-bypass-country` didn't work. 
I also noticed that some links are broken (e.g. with the following command I manage to download episodes 2 and 3, but episode 1 keeps returning errors). Also, these videos are freely available.
Hope this report can help! 

```
stefano@stefano-ubuntu:~/Downloads$ ./yt-dlp --verbose --cookies discoveryplus.com_cookies.txt --geo-bypass -f "bv+ba"  https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-2-del-25-febbraio-2022 
[debug] Command-line config: ['--verbose', '--cookies', 'discoveryplus.com_cookies.txt', '--geo-bypass', '-f', 'bv+ba', 'https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-2-del-25-febbraio-2022']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.03.08.1 [c0c2c57d3] (zip)
[debug] Python version 3.8.10 (CPython 64bit) - Linux-5.4.0-104-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4
[debug] Optional libraries: Cryptodome, secretstorage, sqlite
[debug] Proxy map: {}
[debug] [DiscoveryPlusItaly] Extracting URL: https://www.discoveryplus.com/it/video/fratelli-di-crozza/stagione-6-puntata-2-del-25-febbraio-2022
[debug] Using fake IP 79.17.197.200 (IT) as X-Forwarded-For
[DiscoveryPlusItaly] fratelli-di-crozza/stagione-6-puntata-2-del-25-febbraio-2022: Downloading JSON metadata
[DiscoveryPlusItaly] 1850681: Downloading JSON metadata
[DiscoveryPlusItaly] fratelli-di-crozza/stagione-6-puntata-2-del-25-febbraio-2022: Downloading MPD manifest
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] 1850681: Downloading 1 format(s): dash-5312531e-ab36-4d2b-9df6-d9311cfeba58+dash-9172e635-6040-4472-92fc-984e018dca98
[debug] Invoking downloader on "https://dplus-it-prod-vod.akamaized.net/647f/49f5/f445/057a88f5-1cec-4ed3-827c-677466261903/fmp4/hdntl=exp=1647233530~acl=/647f/49f5/f445/057a88f5-1cec-4ed3-827c-677466261903/fmp4/*~data=hdntl~hmac=1252090fd8d4e3e367c0fa7e3ffd72420759f55674ac5bec944094c127e4463d/master.mpd"
[dashsegments] Total fragments: 2013
[download] Destination: Puntata 2 del 25 febbraio 2022 [1850681].fdash-5312531e-ab36-4d2b-9df6-d9311cfeba58.mp4
[download] 100% of 1.93GiB in 11:29
[debug] Invoking downloader on "https://dplus-it-prod-vod.akamaized.net/647f/49f5/f445/057a88f5-1cec-4ed3-827c-677466261903/fmp4/hdntl=exp=1647233530~acl=/647f/49f5/f445/057a88f5-1cec-4ed3-827c-677466261903/fmp4/*~data=hdntl~hmac=1252090fd8d4e3e367c0fa7e3ffd72420759f55674ac5bec944094c127e4463d/master.mpd"
[dashsegments] Total fragments: 2013
[download] Destination: Puntata 2 del 25 febbraio 2022 [1850681].fdash-9172e635-6040-4472-92fc-984e018dca98.m4a
[download] 100% of 61.08MiB in 05:18
[Merger] Merging formats into "Puntata 2 del 25 febbraio 2022 [1850681].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Puntata 2 del 25 febbraio 2022 [1850681].fdash-5312531e-ab36-4d2b-9df6-d9311cfeba58.mp4' -i 'file:Puntata 2 del 25 febbraio 2022 [1850681].fdash-9172e635-6040-4472-92fc-984e018dca98.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:Puntata 2 del 25 febbraio 2022 [1850681].temp.mp4'
Deleting original file Puntata 2 del 25 febbraio 2022 [1850681].fdash-5312531e-ab36-4d2b-9df6-d9311cfeba58.mp4 (pass -k to keep)
Deleting original file Puntata 2 del 25 febbraio 2022 [1850681].fdash-9172e635-6040-4472-92fc-984e018dca98.m4a (pass -k to keep)
```


I can replicate this issue. I'm willing to share an account to make this happen. 

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
@@ -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>[^/]+)/?(?:[?#]|$)'


Test patch: