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
|
||||
cached_keys = ""
|
||||
|
||||
# assign variable for returned keys
|
||||
returned_keys = []
|
||||
|
||||
|
||||
for key in cdm.get_keys(session_id):
|
||||
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"
|
||||
|
||||
# Cache the keys
|
||||
@@ -85,4 +81,4 @@ def decrypt_content(in_pssh: str = None, license_url: str = None, headers: dict
|
||||
cdm.close(session_id)
|
||||
|
||||
# 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))
|
||||
|
||||
# Get the PSSH
|
||||
pssh = data['pssh']
|
||||
pssh = data['PSSH']
|
||||
|
||||
# Get the license URL
|
||||
lic_url = data['license_url']
|
||||
lic_url = data['License URL']
|
||||
|
||||
# Get the headers
|
||||
headers = data['headers']
|
||||
headers = data['Headers']
|
||||
headers = json.loads(headers)
|
||||
|
||||
# Get the MPD url
|
||||
mpd = data['manifest_url']
|
||||
|
||||
# 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))
|
||||
json_data = data['JSON']
|
||||
|
||||
try:
|
||||
keys = decrypt_content(in_pssh=pssh, license_url=lic_url, headers=headers_dict, mpd=mpd, proxy=proxy)
|
||||
return {"keys": keys}
|
||||
keys = decrypt_content(in_pssh=pssh, license_url=lic_url, headers=headers)
|
||||
return {'Message': f'{keys}'}
|
||||
except Exception as error:
|
||||
return {"keys": [f'{error}']}
|
||||
return {"Message": [f'{error}']}
|
||||
|
||||
|
||||
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