T3rry7f / NoDRM

NoDRM
214 stars 98 forks source link

RSA key format is not supported #30

Open balleno75 opened 3 years ago

balleno75 commented 3 years ago

Hello,

I am trying to extract the key for a Disney + content with PywidevineX, but I am getting the following error,

python.exe .\test.py failed to parse cert as SignedMessage Traceback (most recent call last): File ".\test.py", line 22, in challenge = wvdecrypt.get_challenge() File "C:\Users\kkk\Downloads\NoDRM-master\PywidevineX\pywidevine\decrypt\wvdecrypt.py", line 46, in get_challenge return self.cdm.get_license_request(self.session) File "C:\Users\kkk\Downloads\NoDRM-master\PywidevineX\pywidevine\cdm\cdm.py", line 214, in get_license_request service_public_key = RSA.importKey(session.service_certificate._DeviceCertificate.PublicKey) File "C:\Users\kkk\AppData\Local\Programs\Python\Python38\lib\site-packages\Cryptodome\PublicKey\RSA.py", line 788, in import_key raise ValueError("RSA key format is not supported") ValueError: RSA key format is not supported

This is the data from the test.py file

pssh='AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEPV9OJvzPU++nZ6fz+1mU5I=' license_url='https://disney.playback.edge.bamgrid.com/widevine/v1/obtain-license' headers={'customdata': 'PEtleU9TQXV0aGVudGljYXRpb25YTUw+PERhdGE+PEdlbmVyYXRpb25UaW1lPjIwMTYtMTEtMTkgMDk6MzQ6MDEuOTkyPC9HZW5lcmF0aW9uVGltZT48RXhwaXJhdGlvblRpbWU+MjAyNi0xMS0xOSAwOTozNDowMS45OTI8L0V4cGlyYXRpb25UaW1lPjxVbmlxdWVJZD4wZmZmMTk3YWQzMzQ0ZTMyOWU0MTA0OTIwMmQ5M2VlYzwvVW5pcXVlSWQ+PFJTQVB1YktleUlkPjdlMTE0MDBjN2RjY2QyOWQwMTc0YzY3NDM5N2Q5OWRkPC9SU0FQdWJLZXlJZD48V2lkZXZpbmVQb2xpY3kgZmxfQ2FuUGxheT0idHJ1ZSIgZmxfQ2FuUGVyc2lzdD0iZmFsc2UiIC8+PFdpZGV2aW5lQ29udGVudEtleVNwZWMgVHJhY2tUeXBlPSJIRCI+PFNlY3VyaXR5TGV2ZWw+MTwvU2VjdXJpdHlMZXZlbD48L1dpZGV2aW5lQ29udGVudEtleVNwZWM+PEZhaXJQbGF5UG9saWN5IC8+PExpY2Vuc2UgdHlwZT0ic2ltcGxlIiAvPjwvRGF0YT48U2lnbmF0dXJlPk1sNnhkcU5xc1VNalNuMDdicU8wME15bHhVZUZpeERXSHB5WjhLWElBYlAwOE9nN3dnRUFvMTlYK1c3MDJOdytRdmEzNFR0eDQydTlDUlJPU1NnREQzZTM4aXE1RHREcW9HelcwS2w2a0JLTWxHejhZZGRZOWhNWmpPTGJkNFVkRnJUbmxxU21raC9CWnNjSFljSmdaUm5DcUZIbGI1Y0p0cDU1QjN4QmtxMUREZUEydnJUNEVVcVJiM3YyV1NueUhGeVZqWDhCR3o0ZWFwZmVFeDlxSitKbWI3dUt3VjNqVXN2Y0Fab1ozSHh4QzU3WTlySzRqdk9Wc1I0QUd6UDlCc3pYSXhKd1ZSZEk3RXRoMjhZNXVEQUVZVi9hZXRxdWZiSXIrNVZOaE9yQ2JIVjhrR2praDhHRE43dC9nYWh6OWhVeUdOaXRqY2NCekJvZHRnaXdSUT09PC9TaWduYXR1cmU+PC9LZXlPU0F1dGhlbnRpY2F0aW9uWE1MPg=='}

Can it be a python version problem? I use version 3.8.5, or with cdmapi?

I have also tried to extract the key from a Netflix content and the same error is generated.

You can help me?. Thanks. A greeting.

jesshub commented 3 years ago

I don't have Disney Plus login so can't check, but check the request payload / post data. You'll probably need to modify some of the code.

EgidijusL commented 3 years ago

I had this error yesterday for another platform. Here I found out that no lines are needed: cert=requests.post(license_url,b'\x08\x04').content wvdecrypt.set_certificate(base64.b64encode(cert)) And then all is well.

balleno75 commented 3 years ago

Thank you very much for the help, but commenting on these lines, now this output is generated,

unable to parse license - check protobufs

You can help?. Thanks again. A greeting.

ahopelesshadow commented 2 years ago

I know this is a necro thread, but depending on which scenario you are using for dsnp, L3 could be blocked entirely. Same thing with NF, depending on what you are doing chrome may not actually work.