Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The license request succeeds with 200, but an exception of 'InvalidLicenseMessage' is thrown #25

Closed
mossan0101 opened this issue Apr 3, 2023 · 2 comments
Labels
invalid This doesn't seem right

Comments

@mossan0101
Copy link

mossan0101 commented Apr 3, 2023

I am using a CDM dumped from my Xiaomi device, which works fine for various services. However, for a certain service, I am experiencing the issue mentioned in the title.

I am using disposable bearer tokens for this service, which I can generate on my own and which work properly, so I don't think there is an issue with the headers.

What should I do in this case?
.
.
The following is the response for the license:

'{"service_version_info":{"license_sdk_version":"17.0.1","license_service_version":"DRMtoday"},"supported_tracks":[{"type":"HD","key_id":"Q8eOvWDlSx+MIAvU8K44CQ=="}],"message_type":"LICENSE_REQUEST","status":"OK","license":"CAISiQMKXAogRkI3MTcxNzMwMDAwMDAwMDAxMDAwMDAwMDAwMDAwMDASJgoQPLpOHP3/S2q450lWhjqM/hABMhA6VmJ0Nfyg/h/6+aO8TxPwIAEoADjl/UhA5f1ISNG1rKEGEiIIARABGAAg5f1IKOX9SDDl/Ug4AEIASABQAFgAYAFwAHgAGmYSEAjdFgyJTJzU4FFEUqqU7nIaUG3PpL20gH8pXs5xKXEgFHAHUdNw+G8PHZBrHk9VI4SaPO0nCE2dvs+s72kQ1DlIjM3lEiB2xO8ppwXRYA6lf5CUOiwQptzlxz8+kPG739E7IAEalAEKEEPHjr1g5UsfjCAL1PCuOAkSEKNPXhmgNWGwksn2VEwboZUaIPBguUWx1+7/ys4zHNoI6LcFTecpab8hUvJXrK0i+z5GIAIoATIICAAQKhgAIAA6CAgAECoYACAAQjQKIIwlBSr23yYYmBxNtbfatK3uXtZ82m9ER5Tryl7JnEUxEhD+EYrd5QlDNzh8qhDJrWFIING1rKEGOAAaIA5YaN4hEbbkvgVbzcl+v5hvGMZ63X2eenSLJDoH6sJLIoACpY8LxEV2FRwtalxAnHHBru0zcTG06ZTKKt60bHonCw4LJl/RpNNuepQfdP4Kx7pYY1pobhj45/dPGP8/Zm6IAfnJT3aW0e+nC/e+dKsbE3aDg2NhclpNF7SlAtt+v+vkLpeualRb8AoXyAc5+iiGv1PAMtYxU2vduqg0jpx6nUyCFNllJ8H8BatBMvuvUqgLsfjo43hjuEeq3iscptm4ziJJ4e5Uta5p3ZHvUBVBJBJKZ/divJl22J/VFt5NG/ZSh8jZzw/SA963QS9Hogg3LK94pEn5pJNGTT4TXrNa1NTBRLjSVbkKaHJ4V+QQp3vjSRDnKwpyvPWssE6RkEPH+zoICgYxNy4wLjFAAVgA","platform":"android"}'

The following are the details of the exception:

Could not parse license_message as a SignedMessage, Error parsing message
google.protobuf.message.DecodeError: Error parsing message

During handling of the above exception, another exception occurred:

File "F:\getkeys.py", line 38, in
cdm.parse_license(session_id, licence.content)
pywidevine.exceptions.InvalidLicenseMessage: Could not parse license_message as a SignedMessage, Error parsing message
.
.
Lastly, thank you very much for developing such an amazing program!

@rlaphoenix
Copy link
Member

You are providing the raw API response as the license, which woulde be that JSON data with all the other information. You need to parse the response as json licence.json() then provide the CDM the license key content, so licence.json()['license'] not licence.content.

@rlaphoenix rlaphoenix added the question Further information is requested label Apr 3, 2023
@mossan0101
Copy link
Author

Thank you for providing a clear answer! Thanks to you, I was able to parse the key! 😊

@rlaphoenix rlaphoenix added invalid This doesn't seem right and removed question Further information is requested labels May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants