Repository: yt-dlp/yt-dlp

Issue:
[Zee5] 0-1-6z5177450: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>)
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.07.18** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [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

India

### Provide a description that is worded well enough to be understood

Hi, I am unable to download videos from ZEE5 using the latest version of yt-dlp. The full error traceback is given in the 'verbose log' section. Some links that I tried downloading with,

[](https://www.zee5.com/tv-shows/details/mithai/0-6-3121/mithai-july-17-2022/0-1-6z5177450)

This is the summary of the error that I am getting,

```
yt-dlp https://www.zee5.com/tv-shows/details/mithai/0-6-3121/mithai-july-17-2022/0-1-6z5177450
[Zee5] 0-1-6z5177450: Downloading access token
[Zee5] 0-1-6z5177450: Downloading JSON metadata
ERROR: [Zee5] 0-1-6z5177450: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
```

### Provide verbose output that clearly demonstrates the problem

- [ ] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
yt-dlp -vU --cookies-from-browser opera https://www.zee5.com/tv-shows/details/mithai/0-6-3121/mithai-july-17-2022/0-1-6z5177450
[debug] Command-line config: ['-vU', '--cookies-from-browser', 'opera', 'https://www.zee5.com/tv-shows/details/mithai/0-6-3121/mithai-july-17-2022/0-1-6z5177450']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.07.18 [135f05e] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.4.1-full_build-www.gyan.dev (setts), ffprobe 4.4.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[Cookies] Extracting cookies from opera
[debug] Extracting cookies from: "C:\Users\Ravi\AppData\Roaming\Opera Software\Opera Stable\Network\Cookies"
[debug] Found local state file at "C:\Users\Ravi\AppData\Roaming\Opera Software\Opera Stable\Local State"
[Cookies] Extracted 1194 cookies from opera
[debug] cookie version breakdown: {'v10': 1194, 'other': 0, 'unencrypted': 0}
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.07.18, Current version: 2022.07.18
yt-dlp is up to date (2022.07.18)
[debug] Using fake IP 117.251.235.165 (IN) as X-Forwarded-For
[debug] [Zee5] Extracting URL: https://www.zee5.com/tv-shows/details/mithai/0-6-3121/mithai-july-17-2022/0-1-6z5177450
[Zee5] 0-1-6z5177450: Downloading access token
[Zee5] 0-1-6z5177450: Downloading JSON metadata
ERROR: [Zee5] 0-1-6z5177450: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 644, in extract
  File "yt_dlp\extractor\zee5.py", line 128, in _real_extract
  File "yt_dlp\extractor\common.py", line 1004, in download_content
  File "yt_dlp\extractor\common.py", line 968, in download_handle
  File "yt_dlp\extractor\common.py", line 838, in _download_webpage_handle
  File "yt_dlp\extractor\common.py", line 795, in _request_webpage

  File "yt_dlp\extractor\common.py", line 777, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 3639, 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
urllib.error.HTTPError: HTTP Error 400: Bad Request
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/zee5.py b/yt_dlp/extractor/zee5.py
--- a/yt_dlp/extractor/zee5.py
+++ b/yt_dlp/extractor/zee5.py
@@ -27,19 +27,19 @@ class Zee5IE(InfoExtractor):
                      (?P<id>[^#/?]+)/?(?:$|[?#])
                      '''
     _TESTS = [{
-        'url': 'https://www.zee5.com/movies/details/krishna-the-birth/0-0-63098',
+        'url': 'https://www.zee5.com/movies/details/adavari-matalaku-ardhale-verule/0-0-movie_1143162669',
         'info_dict': {
-            'id': '0-0-63098',
+            'id': '0-0-movie_1143162669',
             'ext': 'mp4',
-            'display_id': 'krishna-the-birth',
-            'title': 'Krishna - The Birth',
-            'duration': 4368,
+            'display_id': 'adavari-matalaku-ardhale-verule',
+            'title': 'Adavari Matalaku Ardhale Verule',
+            'duration': 9360,
             'description': compat_str,
-            'alt_title': 'Krishna - The Birth',
+            'alt_title': 'Adavari Matalaku Ardhale Verule',
             'uploader': 'Zee Entertainment Enterprises Ltd',
-            'release_date': '20060101',
-            'upload_date': '20060101',
-            'timestamp': 1136073600,
+            'release_date': '20070427',
+            'upload_date': '20070427',
+            'timestamp': 1177632000,
             'thumbnail': r're:^https?://.*\.jpg$',
             'episode_number': 0,
             'episode': 'Episode 0',
@@ -84,7 +84,7 @@ class Zee5IE(InfoExtractor):
         'only_matching': True
     }]
     _DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails/secure?content_id={}&device_id={}&platform_name=desktop_web&country=IN&check_parental_control=false'
-    _DEVICE_ID = 'TszZPYPuY9Pq2cJizV0U000000000000'
+    _DEVICE_ID = '1q70TH8Wz0wTyw4buVgg000000000000'
     _USER_TOKEN = None
     _LOGIN_HINT = 'Use "--username <mobile_number>" to login using otp or "--username token" and "--password <user_token>" to login using user token.'
     _NETRC_MACHINE = 'zee5'


Test patch: