Guys, I uploaded a script for getting keys from those sites using DRM from drmtoday.
Also on my GitHub, please enjoy yourself: https://github.com/CrymanChen/WKS-KEYS/blob/7b2cceafdce2727e345454763232a6d5cf131634/l3mubi.py
I haven't tested other similar sites, but one thing I found is that we don't need to add the "specConform=true" anymore.
(P.S. My intention is for those beginners who are trying to find a solution quickly. Tell me if I disobey the rules by accident.)
Support our site by donate $5 directly to us Thanks!!!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
+ Reply to Thread
Results 1 to 30 of 30
-
-
How do you handle the token it needs?
I uploaded a script earlier today, also for DRMToday -
It looks like it still needs the request headers to be copy and pasted into headers.py before running the main script.
-
If you want to skip some manual labor, you can use pyperclip and uncurl libraries to curl the license and handle the parsing in the script rather than having to copy/paste a bunch of things.
To grab any JWT token (not just for DRMtoday), you can look for the pattern and add it to a list:
Code:def get_tokens(headers: dict) -> list: """Collect JWT tokens if present""" try: token_pairs = [ (key, value) for key, value in headers.items() if isinstance(value, str) and (value.startswith("ey") or value.startswith("Bearer")) ] tokens = [token for pair in token_pairs for token in pair] return tokens except KeyError: return None
Code:headers = dict(zip(self.tokens[::2], self.tokens[1::2]))
You can take this logic even further by automatically parsing JSON for license requests and responses, as well. In my own tools, I effectively get keys from 9/10 services without having to specify for each one because almost all of them use similar patterns. -
[CODE]C:\Users\USER\Desktop\WKS_keys>l3mubi.py
PSSH: AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEEzv8t 6gRUKMsEXKL6yzLVM=
License URL: https://lic.drmtoday.com/license-proxy-widevine/cenc/
Traceback (most recent call last):
File "C:\Users\USER\AppData\Local\Programs\Python\Pytho n311\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\AppData\Local\Programs\Python\Pytho n311\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\AppData\Local\Programs\Python\Pytho n311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\AppData\Local\Programs\Python\Pytho n311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\USER\Desktop\WKS_keys\l3mubi.py", line 31, in <module>
correct, keys = WV_Function(pssh, lic_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Desktop\WKS_keys\l3mubi.py", line 26, in WV_Function
license_b64 = widevine_license.json()["license"]
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\AppData\Local\Programs\Python\Pytho n311\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[CODE]
Had a problem running the script, any ideas on what went wrong -
-
Code:
import requests headers = { 'Accept': '*/*', 'Accept-Language': 'en-US,en;q=0.6', 'Connection': 'keep-alive', 'Origin': 'https://mubi.com', 'Referer': 'https://mubi.com/', 'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Site': 'cross-site', 'Sec-GPC': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36', 'dt-custom-data': '', 'Content-Type': 'application/x-www-form-urlencoded', } data = '' response = requests.post('https://lic.drmtoday.com/license-proxy-widevine/cenc/', headers=headers, data=data)
-
-
-
I'm testing this python script and it fails too. I attach debug output and headers.
What's the problem?
Thanks. -
no need full header, just like this...
Code:import requests headers = { 'dt-custom-data': 'eyJ1c2VySWQiOjE1OTk5MzA1LCJzZXNzaW9uSWQiOiJkODNmODYzNmEzMGRkMTBiNjkwZmEwNmU1MjJjMWMxMGY0MjE0OSIsIm1lcmNoYW50IjoibXViaSJ9', }
Code:--key 5316ad62c1694cef884a65dc147c848f:c17ac38542d04be762f800e5cc32663c
[Attachment 75856 - Click to enlarge]Last edited by iamghost; 31st Dec 2023 at 07:39.
-
I re-downloaded the l3mubi.py script and WKS-KEYS.zip, mine were outdated.I have copied "device_client_id_blob", "device_private_key" and "google_sdk_gphone64_x86_64_16.1.0_0f2d0892_22596_l 3.wvd" to folder "pywidevine/L3/cdm/devices/android_generic/".
I created a Python virtual environment and installed all the Python modules:
Code:$ pip list Package Version ------------------ ---------- beautifulsoup4 4.12.2 certifi 2023.11.17 charset-normalizer 3.3.2 idna 3.6 pip 23.3.2 protobuf 3.19.5 pycryptodome 3.19.1 pycryptodomex 3.19.1 requests 2.31.0 setuptools 69.0.2 soupsieve 2.5 urllib3 2.1.0 wheel 0.42.0 xmltodict 0.13.0
-
I think I am missing a json file in the folder "pywidevine/L3/cdm/devices/android_generic/".
How could I create this file? -
there is no json file
[Attachment 75859 - Click to enlarge]
what is your python version?
[Attachment 75860 - Click to enlarge] -
don't think it's that json file or python version issues, I remembered crymanchen's script requires urllib3 version<2, you can try downgrade to 1.26.17 and give a try.
-
thanks, I have reported the error and I think the problem is in the response: 406. The script was developed on Windows and I execute it on Linux. I think the problem is something with the encoding or a missing header.
-
Hmm... I don't think so...
My pip list returned a 'urllib3==2.1.0'. So my urllib version is the same as his.
But mine's working properly.
[Attachment 75870 - Click to enlarge]
Although I replied @j1simon on GitHub, I still have no clue. -
I and another people met this error before when run l3_nowE.py:
Code:D:\N_m3u8DL-RE_Beta_win-x64\WKS-KEYS>l3_NowE.py Traceback (most recent call last): File "D:\N_m3u8DL-RE_Beta_win-x64\WKS-KEYS\l3_NowE.py", line 21, in <module> requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'urllib3.util.ssl_' has no attribute 'DEFAULT_CIPHERS'
-
In my case the problem is that somewhere in the pywidevine code some characters are injected that the server does not accept:
Code:HTTP Status 406 \xe2\x80\x93 Not Acceptable
-
So "\xe2\x80\x93" means a dash...
Will ya copy & paste the cURL (bash) of the license request, and then convert it to Python style, and paste the headers to headers.py.
Then make some changes to l3mubi.py:
1. delete Line 70Code:dt_custom_data = input('dt-custom-data: ')
Code:widevine_license = requests.post(url=lic_url, data=wvdecrypt.get_challenge(), headers={ 'dt-custom-data': dt_custom_data, })
3. In the end, add another line in the beginning "from headers import headers"
4. So you've got a headers.py and a l3mubi.py running together.
My intention is that to use the most traditional way to try to get the key, and some stuff may be missing in the headers, and let's make it full.
I uploaded a script changed according to the steps above so you can make a comparison.
Please rename it back to '.py' 'cause this site doesn't allow users to upload python scripts.
If it also does not work, I won't 'investigate into' it I'm sorry. I got other things to do. But please let me know the result anyway. -
Thanks @CrymanChen. I have been testing and the problem is not your code but the "custom" pywidevine it uses. I'm trying to figure out where the bug is.
-
I installed Windows 11 in a virtual machine to test and same error!
What version of python and libraries do you use? -
Why not just ask others who have also used this script? Do they have the same issue as you do?
As for the Python version, it worked under several different versions including the latest. And the libraries, just install the requirements.txt on the GitHub page.
P.S. One more thing dear Juan, please do not duplicate your questions, I mean you have uploaded the same content on GitHub issues page and in this forum. Please, please just choose one of them, really appreciated. -
I'm debugging the code and in "widevine_license=requests.post(url=lic_url, data=wvdecrypt.get_challenge(), headers=headers.headers)" it doesn't send this code "\xe2\x80\x93".On Linux it does not send these codes either.
-
I used the script to get the keys without an issue today:
Tested for both Python 3.11.7 and 3.12.1 versions.
Code:PS C:\Python\MUBI-Keys>python l3mubi.py PSSH: AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEAq7c8KghU8svOti1U0yamg= License URL: https://lic.drmtoday.com/license-proxy-widevine/cenc/ dt-custom-data: eyJ1c2VySWQiOjE1ODY0NTIzLCJzZXNzaW9uSWXXXXXXXXXXXXXXXXXXXXXXXXXXXX --key 0abb73c2a0854f2cbceb62d54d326a68:2815a44504d5c87fc4d9083bf4d3fb17
Last edited by Spectrumhsm; 5th Jan 2024 at 16:55.
Similar Threads
-
Script for fetching keys for Apple TV+
By CrymanChen in forum Video Streaming DownloadingReplies: 19Last Post: 3rd Mar 2025, 14:09 -
Need help with lic.drmtoday.com license server
By TheGreatUnknown90 in forum Video Streaming DownloadingReplies: 51Last Post: 20th May 2024, 14:33 -
wks-keys or TPD-Keys cmd.exe errors
By euphonic in forum Video Streaming DownloadingReplies: 1Last Post: 25th Jun 2023, 14:24 -
Help with getting keys for Channel 5 series
By IPTV in forum Video Streaming DownloadingReplies: 6Last Post: 17th Feb 2023, 05:05 -
MUBI Multiple Subtitles
By yarrak in forum Video Streaming DownloadingReplies: 4Last Post: 22nd Mar 2022, 03:02