CrymanChen/WKS-KEYS

l3mubi.py fails "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

simonbcn opened this issue · 7 comments

Arch Linux
Python 3.11.7

Script executed in Python Virtual environment with this libraries:

$ 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

This is the debug output:

Key ID: 7nIbOM8wTqma7ns6l00pPQ==
PSSH: AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEO5yGzjPME6pmu57OpdNKT0=
License URL: https://lic.drmtoday.com/license-proxy-widevine/cenc/
dt-custom-data: eyJ1c2VySWQiOjE1OTk5MzA1LCJzZXNzaW9uSWQiOiJkODNmODYzNmEzMGRkMTBiNjkwZmEwNmU1MjJjMWMxMGY0MjE0OSIsIm1lcmNoYW50IjoibXViaSJ9
DEBUG:pywidevine.L3.cdm.cdm:open_session(init_data_b64=AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEO5yGzjPME6pmu57OpdNKT0=, device=DeviceConfig(name=android_generic, description=android studio cdm, security_level=3, session_id_type=android, private_key_available=True, vmp=False)
INFO:pywidevine.L3.cdm.cdm:opening new cdm session
DEBUG:pywidevine.L3.cdm.cdm:trying to parse init_data directly
DEBUG:pywidevine.L3.cdm.cdm:init_data:
DEBUG:pywidevine.L3.cdm.cdm:key_id: "\356r\0338\3170N\251\232\356{:\227M)="
INFO:pywidevine.L3.cdm.cdm:session opened and init data parsed successfully
DEBUG:pywidevine.L3.cdm.cdm:get_license_request(session_id=b'FE9AD0CA9B3F42670100000000000000')
INFO:pywidevine.L3.cdm.cdm:getting license request
DEBUG:pywidevine.L3.cdm.cdm:building license request
DEBUG:pywidevine.L3.cdm.cdm:signing license request
DEBUG:pywidevine.L3.cdm.cdm:license request:
DEBUG:pywidevine.L3.cdm.cdm:Type: LICENSE_REQUEST
DEBUG:pywidevine.L3.cdm.cdm:Msg {
DEBUG:pywidevine.L3.cdm.cdm:  ClientId {
DEBUG:pywidevine.L3.cdm.cdm:    Type: DEVICE_CERTIFICATE
DEBUG:pywidevine.L3.cdm.cdm:    Token {
DEBUG:pywidevine.L3.cdm.cdm:      _DeviceCertificate {
DEBUG:pywidevine.L3.cdm.cdm:        Type: USER_DEVICE
DEBUG:pywidevine.L3.cdm.cdm:        SerialNumber: "\367\225=\345\262\202\022\343N\242AT\360\352cl"
DEBUG:pywidevine.L3.cdm.cdm:        CreationTimeSeconds: 1588279017
DEBUG:pywidevine.L3.cdm.cdm:        PublicKey: "0\202\001\n\002\202\001\001\000\342\305\n\016\233\314\033\370\235\027\312\002\037\220\025K\001]\344\311>\254L\016\006\302\3311\207e\211u\236\326\031\375\231\321:\273\332c\262\277\233.\266c\224\254L\026\243\317\305\262\024p-H\213\260EJ7\266\025\337$\306v\210\246\264\026\3043\340+\343RK\036\357R~9\331<\201\324\277e\307\177Y\006\335\017\225\027\360\216@\250u\177\210\367/\250\006\006\273\334\324a\356\023\333\264\274\327{\372\377\271\261AhK\276i\031\003d\034\030>\241\340\037Th\024\273\262\024\323#~\241\234>\213\006\305\307\203\266\363\362\262`q\007\335\307\223g\257\232^_\215\326\006\203\253q\317\235t\203\345\305<1o\354d\262\324\253\226\252+|\334\312\263>[=\250\004\014\223\005\034\323\230 \2148F\010\245\270\376\237{~}\267X1D\335<\322J\304/\310\222\312\003{=\240\226\355$ \377\200\341\330\250;\347Z\1773?\002\003\001\000\001"
DEBUG:pywidevine.L3.cdm.cdm:        SystemId: 4464
DEBUG:pywidevine.L3.cdm.cdm:      }
DEBUG:pywidevine.L3.cdm.cdm:      Signature: "\265E\207\r$H\002\002\260p\230\342\030u\200\356\341\302r\010\274\264\215\242\032\241\267\3121\223\332\001\016\317\013}\347\030\177\ns\2232=j\r&\360g\000{K\361\352&\013\347s\312bl\241?\372$\002\244\022\260\320O\202\0130}v\177\000<E\222ZsS^\006K\311S\030\r\222\301\271\3003Z\237\\d\264\335\0004\356Wv\370v\014\n\021\327\335\2733aX\201\024e\336m\r\217\257\347\266(\364\233\270g\210S\332BG4\361\0273\376gF\034(\302\377yP\235R\027\'|\327\210|\311\341\276\316\244\342\024\007\335S^\3329\tu\356\214mQ\r\234M\r0\245\231H\263*&=\222\351\313\237\033&)@X\361\360\261\021W\016Ihu~R\270\300,hp\352\231\307\23295\226\273\370,0\202\334$\261\301\230\210GV_\203\375\214\t|$\333\211\273\344s.\024\305f\035\006Y\362\""
DEBUG:pywidevine.L3.cdm.cdm:      Signer {
DEBUG:pywidevine.L3.cdm.cdm:        _DeviceCertificate {
DEBUG:pywidevine.L3.cdm.cdm:          Type: INTERMEDIATE
DEBUG:pywidevine.L3.cdm.cdm:          SerialNumber: "i\343\350\230\273,?\270\243\263(\035\204\370\214\024"
DEBUG:pywidevine.L3.cdm.cdm:          CreationTimeSeconds: 1378855566
DEBUG:pywidevine.L3.cdm.cdm:          PublicKey: "0\202\001\n\002\202\001\001\000\330\366\351\265\211\360Q \351\244>\320\331N\241\376\t\225\001m\275\036+@\247\334\321\305\177\303\005P<\317\023?\236\230\257\316N\346\377\204\334B$&\250\377\372O\344\277-D\325\017\024:\353\274 L\243\264g\372%\033\372`?\333%\342\'\250\257\251\303}\n\357b\346\243\224\327((\237\324\226e\033.\214QA\362|U\255\3469/7\252\323o7\316}B\203[-q~-8t\373\272\323\363\024o\321x1P\267C\277\030\271sW\000tw[\'\335\"\214;\205\313\216\026]\235\312\355\027\330\345\216\230;\3063\010\226u\211R\254C\243\264\320\221<\255&e%\322G\014\355\271\335\004\267\253\001\322E\031\245\334\352\204\230\341\343r\374\201\203\226\342\302A\035\312dD,\313\371\213y]`\201\01680Z\373\\\343>\255\337\270\377}x\253\367^A\270\307\2525\205\271Z\374\210\206\212n\257\221\353t\241\002\003\001\000\001"
DEBUG:pywidevine.L3.cdm.cdm:          SystemId: 4464
DEBUG:pywidevine.L3.cdm.cdm:        }
DEBUG:pywidevine.L3.cdm.cdm:        Signature: "\"\213c0\353?\220\263V\357\277\021\222\266\'\275\266\227 \240\355\256\002\336Y\276\375\002\r{\353\026\\\'I\272>\251\036\365F\355\210\225\225\225I\263y]\204\210\017\0070\0071\343c\312\315\257w\340\261{R&\334\270\333\227c5\013E\347\342v\216\260!\177t6\233\261\010\345\252!djC\330M\034\257\347U\217\332<\307K\211GcVG\301U\241T\022]\232Zws?\341\014\301,\333h\376\334\376P\254\231\301\256\322s\367\223A\315\276e\300\322\335\221\016\336Q\221\260\177:\340\247\377pA\257%\020A\251\312I\\\247\306\370\213j\021m@\000\372m\216\350 \316fD\315\032\271\3051\237\352\212\376mz\312\214*AK\321\265H\354\257\010\321u\223\234\372\224o\n\261x`C\022\372\0001\314\242\351q\275B\"\207#\330\344\312b\231\325\337Q\321\020\344p6\022\243b5SH;\212\217\323N\343[\235r\001\344\341:\274\270\'m\261\263\304]\220\200\2458`\032\270\262%\322R\300\341\371L\315o\225}\ty\305\214O\320Nm\272\031\364\207\3578\340;%S\306E\355M]Sd)\254\200)}\365\303\367\010\000\000)6\351\030 \313\307\275\353?\"\363\257\376a\214\231BG=\204\207B\000Dk\200F\002\021\260r\314\343ku\020\354\324\312\322\375\310u\232\205y\244\233\372\334\022\n\275\001\306\274\271"
DEBUG:pywidevine.L3.cdm.cdm:      }
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "company_name"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "Google"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "model_name"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "Android SDK built for x86"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "architecture_name"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "x86"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "device_name"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "generic_x86"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "product_name"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "sdk_google_phone_x86"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "build_info"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "google/sdk_google_phone_x86/generic_x86:7.1.1/NYC/5464897:userdebug/test-keys"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "device_id"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "zdfDCPHaHrBQakqKhEcFqXiLwbblJwg\000"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "widevine_cdm_version"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "v4.1.0-android"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    ClientInfo {
DEBUG:pywidevine.L3.cdm.cdm:      Name: "oem_crypto_security_patch_level"
DEBUG:pywidevine.L3.cdm.cdm:      Value: "0"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:    _ClientCapabilities {
DEBUG:pywidevine.L3.cdm.cdm:      SessionToken: 1
DEBUG:pywidevine.L3.cdm.cdm:      MaxHdcpVersion: HDCP_NONE
DEBUG:pywidevine.L3.cdm.cdm:      OemCryptoApiVersion: 11
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:  }
DEBUG:pywidevine.L3.cdm.cdm:  ContentId {
DEBUG:pywidevine.L3.cdm.cdm:    CencId {
DEBUG:pywidevine.L3.cdm.cdm:      Pssh {
DEBUG:pywidevine.L3.cdm.cdm:        key_id: "\356r\0338\3170N\251\232\356{:\227M)="
DEBUG:pywidevine.L3.cdm.cdm:      }
DEBUG:pywidevine.L3.cdm.cdm:      LicenseType: DEFAULT
DEBUG:pywidevine.L3.cdm.cdm:      RequestId: "FE9AD0CA9B3F42670100000000000000"
DEBUG:pywidevine.L3.cdm.cdm:    }
DEBUG:pywidevine.L3.cdm.cdm:  }
DEBUG:pywidevine.L3.cdm.cdm:  Type: NEW
DEBUG:pywidevine.L3.cdm.cdm:  RequestTime: 1704098172
DEBUG:pywidevine.L3.cdm.cdm:  ProtocolVersion: CURRENT
DEBUG:pywidevine.L3.cdm.cdm:  KeyControlNonce: 2101099883
DEBUG:pywidevine.L3.cdm.cdm:}
DEBUG:pywidevine.L3.cdm.cdm:Signature: "\177h3n\227}\331\300C\004\3176\356E\211\331\313\035\nQ]\245*\321T\347\267\257\035\20677\335\371D\354\253\244\307\014\323C\364t\273\213\202#\334\354\247>lR\007Y\345\263k*]\324NPo\356\271\220\230@+\370\207\233\263\277n\002\266!\324V\351p;\360&<\241\273D\"\t\003f\364\310Q\376\367\301LW\372\004\240v\346\226\266\215\031T\230E\305\253EU\311\334uNA!-\032\330k\304\365m,\321\200\234c\220\323\325\310\213\036\023\335\332\r#\217\303\304\010\002\223\n\235\013\031\2072kO\342\'\262rN3u]\304!\366\305\363\247\346\215\204m\271\222Y\014k\335\206\375\024__\033\235\327\307\220\257\004S\372\367)\317\300\024E)\001\325)\236\262\300\237 \213(Ci,5\375\031v\312B\327x\275d\023m\360\031\274\236\006\226D\350AE\304\330\302\rg\200)\205\260\245oGP\361"
INFO:pywidevine.L3.cdm.cdm:license request created
DEBUG:pywidevine.L3.cdm.cdm:license request b64: b'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'
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): lic.drmtoday.com:443
DEBUG:urllib3.connectionpool:https://lic.drmtoday.com:443 "POST /license-proxy-widevine/cenc/ HTTP/1.1" 406 441
Traceback (most recent call last):
  File "/home/juan/.virtualenvs/wks-keys/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/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 "/multimedia2/scripts-descarga/WKS-KEYS/l3mubi.py", line 81, in <module>
    correct, keys = WV_Function(pssh, lic_url)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/multimedia2/scripts-descarga/WKS-KEYS/l3mubi.py", line 76, in WV_Function
    license_b64 = widevine_license.json()["license"]
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/juan/.virtualenvs/wks-keys/lib/python3.11/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)

I think the problem is the response from licence server: urllib3.connectionpool:https://lic.drmtoday.com:443 "POST /license-proxy-widevine/cenc/ HTTP/1.1" 406 441

HTTP 406 error code: Not Acceptable. It indicates that the server cannot produce a response matching the list of acceptable values defined in the request's proactive content negotiation headers, and that the server is unwilling to supply a default representation.

Proactive content negotiation headers include:

Accept
Accept-Encoding
Accept-Language
In practice, this error is very rarely used. Instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. It is assumed that even if the user won't be completely happy, they will prefer this to an error code.

If a server returns such an error status, the body of the message should contain the list of the available representations of the resources, allowing the user to choose among them.

Hi Juan,
Thanks for providing such detailed output. I tried duplicating your issue and found out that the key returned correctly, thanks to your dt-custom-data not expiring yet.
20240101165246
So I would request you that please try again.

And it's also noteworthy that I wrote this script to simplify the key-getting process on my Windows laptop. However, I saw some paths like Linux ("/home/user/..."), as well as those "Arch Linux" characters. I'm not sure if it works on Unix operating systems, but please run it on Windows platform if possible. Thanks for your attention.

Yes, I'm running this on Linux. I don't have Windows.
So it must be a problem with enconding, do you know which scripts I should check?

First, based on your OS, I would prefer this below on your virtual env:
print(f'Status code: {widevine_license.status_code}, \nLicense Response: {widevine_license.content}')
to see what license server returned under an HTTP 406 error like you said.
Next, the error printed on your screen indicated that the response didn't look right. If so, I have no idea yet, sorry.
I can email you the content key you are requesting if you like.

This is the server response:

HTTP Status 406 \xe2\x80\x93 Not Acceptable

Then I may suggest that you turn to others who you trust, and provide the cURL of the license request and then let them try editing this script. I can't imagine what could lead to this error (Linux does support Widevine L3.)

I have installed Windows 11 in VirtualBox but same error: 😮

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\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\Downloads\WKS-KEYS\l3mubi.py", line 82, in <module>
    correct, keys = WV_Function(pssh, lic_url)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\Downloads\WKS-KEYS\l3mubi.py", line 77, in WV_Function
    license_b64 = widevine_license.json()["license"]
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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)

What version of Python do you use? What version of libraries do you use?

I'm using (in Windows) python 3.12 and this libraries:

Package            Version
------------------ ----------
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
pyperclip          1.8.2
requests           2.31.0
urllib3            2.1.0
xmltodict          0.13.0