Repository: yt-dlp/yt-dlp

Issue:
[Zee5] 0-1-6z5215055: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>);
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.09.01** ([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/yt-dlp/yt-dlp/wiki/FAQ#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,

This is the summary of the error that I am getting,

```
yt-dlp https://www.zee5.com/tv-shows/details/mithai/0-6-3121/halla-party-is-dressed-as-rajasthani-dancers/0-1-6z5215055
[Zee5] 0-1-6z5215055: Downloading access token
[Zee5] 0-1-6z5215055: Downloading JSON metadata
ERROR: [Zee5] 0-1-6z5215055: 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

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] 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/halla-party-is-dressed-as-rajasthani-dancers/0-1-6z5215055
[debug] Command-line config: ['-vU', '--cookies-from-browser', 'opera', 'https://www.zee5.com/tv-shows/details/mithai/0-6-3121/halla-party-is-dressed-as-rajasthani-dancers/0-1-6z5215055']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.09.01 [5d7c7d6] (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 3210 cookies from opera
[debug] cookie version breakdown: {'v10': 3210, 'other': 0, 'unencrypted': 0}
[debug] Proxy map: {}
[debug] Loaded 1670 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.09.01, Current version: 2022.09.01
yt-dlp is up to date (2022.09.01)
[debug] Using fake IP 117.249.197.213 (IN) as X-Forwarded-For
[debug] [Zee5] Extracting URL: https://www.zee5.com/tv-shows/details/mithai/0-6-3121/halla-party-is-dressed-as-rajasthani-dancers/0-1-6z5215055
[Zee5] 0-1-6z5215055: Downloading access token
[Zee5] 0-1-6z5215055: Downloading JSON metadata
ERROR: [Zee5] 0-1-6z5215055: 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 670, in extract
  File "yt_dlp\extractor\zee5.py", line 128, in _real_extract
  File "yt_dlp\extractor\common.py", line 1030, in download_content
  File "yt_dlp\extractor\common.py", line 994, in download_handle
  File "yt_dlp\extractor\common.py", line 864, in _download_webpage_handle
  File "yt_dlp\extractor\common.py", line 821, in _request_webpage

  File "yt_dlp\extractor\common.py", line 803, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 3656, 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
@@ -1,4 +1,6 @@
 import json
+import random
+import string
 
 from .common import InfoExtractor
 from ..compat import compat_str
@@ -84,7 +86,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 = '1q70TH8Wz0wTyw4buVgg000000000000'
+    _DEVICE_ID = ''.join(random.choices(string.ascii_letters + string.digits, k=20)).ljust(32, '0')
     _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: