Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb5bc8ac4a | ||
|
|
bd05017ac0 | ||
|
|
b277cbdce3 |
Binary file not shown.
@@ -69,13 +69,9 @@ def decrypt_content(in_pssh: str = None, license_url: str = None, headers: dict
|
|||||||
# Assign variable for caching keys
|
# Assign variable for caching keys
|
||||||
cached_keys = ""
|
cached_keys = ""
|
||||||
|
|
||||||
# assign variable for returned keys
|
|
||||||
returned_keys = []
|
|
||||||
|
|
||||||
|
|
||||||
for key in cdm.get_keys(session_id):
|
for key in cdm.get_keys(session_id):
|
||||||
if key.type != "SIGNING":
|
if key.type != "SIGNING":
|
||||||
returned_keys.append(f"--key {key.kid.hex}:{key.key.hex()}")
|
|
||||||
cached_keys += f"{key.kid.hex}:{key.key.hex()}\n"
|
cached_keys += f"{key.kid.hex}:{key.key.hex()}\n"
|
||||||
|
|
||||||
# Cache the keys
|
# Cache the keys
|
||||||
@@ -85,4 +81,4 @@ def decrypt_content(in_pssh: str = None, license_url: str = None, headers: dict
|
|||||||
cdm.close(session_id)
|
cdm.close(session_id)
|
||||||
|
|
||||||
# Return the keys
|
# Return the keys
|
||||||
return returned_keys
|
return cached_keys
|
||||||
|
|||||||
37
main.py
37
main.py
@@ -16,44 +16,23 @@ def post_endpoint():
|
|||||||
print(json.dumps(data, indent=4))
|
print(json.dumps(data, indent=4))
|
||||||
|
|
||||||
# Get the PSSH
|
# Get the PSSH
|
||||||
pssh = data['pssh']
|
pssh = data['PSSH']
|
||||||
|
|
||||||
# Get the license URL
|
# Get the license URL
|
||||||
lic_url = data['license_url']
|
lic_url = data['License URL']
|
||||||
|
|
||||||
# Get the headers
|
# Get the headers
|
||||||
headers = data['headers']
|
headers = data['Headers']
|
||||||
|
headers = json.loads(headers)
|
||||||
|
|
||||||
# Get the MPD url
|
# Get the MPD url
|
||||||
mpd = data['manifest_url']
|
json_data = data['JSON']
|
||||||
|
|
||||||
# Get the proxy if there is one
|
|
||||||
if data['proxy'] != None:
|
|
||||||
proxy = data['proxy']
|
|
||||||
print(proxy)
|
|
||||||
else:
|
|
||||||
proxy = None
|
|
||||||
|
|
||||||
# Format the headers
|
|
||||||
|
|
||||||
# Split the string into lines
|
|
||||||
lines = headers.strip().split('\n')
|
|
||||||
|
|
||||||
# Create an empty dictionary to store the key-value pairs
|
|
||||||
headers_dict = {}
|
|
||||||
|
|
||||||
# Iterate through each line and split it into key-value pairs
|
|
||||||
for line in lines:
|
|
||||||
key, value = line.split(': ', 1) # Split only at the first occurrence of ': ' to handle values containing ': '
|
|
||||||
headers_dict[key] = value
|
|
||||||
|
|
||||||
print(json.dumps(headers_dict, indent=4))
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
keys = decrypt_content(in_pssh=pssh, license_url=lic_url, headers=headers_dict, mpd=mpd, proxy=proxy)
|
keys = decrypt_content(in_pssh=pssh, license_url=lic_url, headers=headers)
|
||||||
return {"keys": keys}
|
return {'Message': f'{keys}'}
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
return {"keys": [f'{error}']}
|
return {"Message": [f'{error}']}
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
BIN
wvg-next-cdrm.zip
Normal file
BIN
wvg-next-cdrm.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user