Link:
I can't seem to get a key for this, I don't know what I'm missing.Code:https://mubi.com/en/es/films/the-national-shotgun
Is this the right PSSH:
And is this the right license:Code:AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEBGr2TtlgUfZnETAg3Gy4Gw=
Maybe it's the custom data but I'm using the same one that passes in Chrome (and I have reloaded the video 10 times and it's always been the same one so I don't think it has an expiration?)Code:https://lic.drmtoday.com/license-proxy-widevine/cenc/
Anyway, if someone can get me the key I'd be grateful.
+ Reply to Thread
Results 1 to 11 of 11
-
-
You need to use custom data as only header, and append a missing section to the license:
Code:headers = { "Dt-Custom-Data": "TOKEN", }
Code:https://lic.drmtoday.com/license-proxy-widevine/cenc/?SpecConform=True
-
no dice, still getting an error. a different one, though:
Code:Traceback (most recent call last): File "D:\Utilities\WEB-DL-Tools\Skidatelj\.venv\lib\site-packages\pywidevine\cdm.py", line 388, in parse_license signed_message.ParseFromString(license_message) google.protobuf.message.DecodeError: Error parsing message During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Utilities\WEB-DL-Tools\Skidatelj\keys.py", line 11, in <module> keys = get_keys( File "D:\Utilities\WEB-DL-Tools\Skidatelj\helpers\cdm.py", line 29, in get_keys cdm.parse_license(session_id, licence.content) File "D:\Utilities\WEB-DL-Tools\Skidatelj\.venv\lib\site-packages\pywidevine\cdm.py", line 392, in parse_license raise InvalidLicenseMessage(f"Could not parse license_message as a SignedMessage, {e}") pywidevine.exceptions.InvalidLicenseMessage: Could not parse license_message as a SignedMessage, Error parsing message
-
Invalid LicenseMessage is probably caused by the response being in something other than bytes or b64, most likely JSON. I don't have access to Mubi so I can't check, but if you print out the response.content, you'll see what the response looks like and be able to handle it properly.
-
your key
Code:11abd93b658147d99c44c08371b2e06c:eca26cc41a7d5f8176c8645bb0d105d4
[Attachment 77100 - Click to enlarge] -
thanks cedric
Here's the content:
Code:{ "service_version_info":{ "license_sdk_version":"18.1.2", "license_service_version":"DRMtoday" }, "supported_tracks":[ { "type":"HD", "key_id":"DBEA9NrSQWaslDO3MffFQg==" } ], "message_type":"LICENSE_REQUEST", "status":"OK", "license":"CAIShAMKTgogMDNFOUQ2NzgwMDAwMDAwMDAxMDAwMDAwMDAwMDAwMDASJgoQLNAfLnfgQfCTPyh02lvy5BABMhA6VmJ0Nfyg/h/6+aO8TxPwIAEoABInCAEQARgAIICangEogMYKMIDgqAE4AEIASABQAFgAYAFwAHgBgAEAGmYSEJ6w287A9zPZtBCMCCnKG/waUFAUgmcJUe1BgaexDIPds8I36AyZGsG+M3CrzW+x4Df4lDiU2Q2dUkXaMHoXv/W7SBi6ib9wXu9S5nySmdERZN5NsrsbBkzSE1Dh94lJm9Z/IAEamAEKEAwRAPTa0kFmrJQztzH3xUISEOsNoOde3QVCDZGGnh7XsmsaINRJICODDZFwk6OFI5otUD+pFdTu7GxfuXcW/vYEHes/IAIoATIICAAQKhgAIAA6CAgAECoYACAAQjQKIF1xhtjiWYz830cgyfoYp94jOSMsmxM1KopvAPWfRXapEhDZeVe9bNEZ2j5I8L5skWrrYgJIRCDYwMeuBjgAGiBc3icKH3zqRo6eccaTX5dgfSsfwOHRWJVRyaFfaXu+/CKAAh+Wn6S67qyorWbG5ryV+OuHfsOm/cKgttCTiFDs/NjS/SrI9/ske5EKp+ZlQ3ravPfyIcg7I9DOi23JI4DUpUIwX7vNWQAyLzKOZaH6oVwodZgTmCErFEdllvcsa1NlVP5UZ4CdQpNZn/pqEgVARBD+E4Qia2u4l3/1CZ0EDQ7yA5MnAZsXLf8Fi9ploGlGP/B0xqxmSK2zPpmVidmSicW/ygiUzenYV1ITKmVyZCoDIuarfj+xRYikvsZ6pA78jKqCRLUHCv7hArec4hBzC7/kmnEkGVGp51ohYmFIMFnKgG4hBj+IcjmGIZH53xZEnoHvUuOuhDjZFJzhSThPccw6CAoGMTguMS4yQAFYAA==", "platform":"android" }
EDIT: I think that's it.
For whoever might also be having problems:
when dealing with mubi and using pywidevine licence.content is a bytestring containing a JSON string. First you need to decode it to a string, then serialize it into an object or a dictionary, and finally take the "license" property which contains a string and send that string into the parse_license method instead of licence_content.Last edited by ampersand; 18th Feb 2024 at 05:16.
-
The "license" is the message you need to parse with cdm.parse_license:
Code:cdm.parse_license(session_id, licence.json()["license"])
-
-
Code:
import base64 def get_pssh(keyId): array_of_bytes = bytearray( b'\x00\x00\x002pssh\x00\x00\x00\x00') array_of_bytes.extend(bytes.fromhex("edef8ba979d64acea3c827dcd51d21ed")) array_of_bytes.extend(b'\x00\x00\x00\x12\x12\x10') array_of_bytes.extend(bytes.fromhex( keyId.replace("-", ""))) return base64.b64encode(bytes.fromhex(array_of_bytes.hex())) kid = input("Please input KID in hex string: ") kid = kid.replace('-', '') assert len(kid) == 32 and not isinstance(kid, bytes), "wrong KID length" print("PSSH {}".format(get_pssh(kid).decode('utf-8')))
-
A browser-based tool to generate a Widevine PSSH from a KID:
https://emarsden.github.io/pssh-box-wasm/generate/ -
OK, it was an EME Logger error on my side.
EME Logger didn't give me any init data at first.
After fixing EME Logger, I got a long init data and found PSSH.
Similar Threads
-
Script for fetching keys for MUBI (drmtoday series)
By CrymanChen in forum Video Streaming DownloadingReplies: 29Last Post: 5th Jan 2024, 16:22 -
Mubi Subtitles Downloader
By razdemar27 in forum Video Streaming DownloadingReplies: 8Last Post: 31st Aug 2023, 12:08 -
MUBI Multiple Subtitles
By yarrak in forum Video Streaming DownloadingReplies: 4Last Post: 22nd Mar 2022, 03:02 -
Extract subtitles from mubi.com
By linuz in forum SubtitleReplies: 0Last Post: 9th Mar 2020, 14:37 -
How to download streams from mubi.com?
By pedrothelion in forum Video Streaming DownloadingReplies: 1Last Post: 17th Aug 2019, 03:06