import base64
import json
def decode_base64(data):
missing_padding = 4 - len(data) % 4
if missing_padding:
data += '=' * missing_padding
return base64.urlsafe_b64decode(data)
licenseServerUri = input('base64: ')
licenseServer = decode_base64(licenseServerUri).decode('utf-8')
licenseServerdata = json.loads(licenseServer)
keys = ""
for key in licenseServerdata['keys']:
kid = key['kid']
k = key['k']
keys += f"--key {decode_base64(kid).hex()}:{decode_base64(k).hex() } "
print(keys)
Run in this form
thank you
main.py -b eyJrZXlzIjpbeyJrdHkiOiJvY3QiLCJhbGciOiJBMTI4S1ciLC JraWQiOiI2WURETVBLeVNTLWRoaTRRMjJscVJ3IiwiayI6IkNk U0dQZTRLUWlhcXJGdHB1anJQV2cifV19
Support our site by donate $5 directly to us Thanks!!!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
Try StreamFab Downloader and download streaming video from Netflix, Amazon!
+ Reply to Thread
Results 1 to 6 of 6
-
-
seems it need argparse module. i never used this method, i think you can easily find argparse usage with google, not complex.
by the way, the script works for decode clear key, right? -
Code:
import base64 import json import sys def decode_base64(data): # Fix padding and decode base64 URL-safe string missing_padding = 4 - len(data) % 4 if missing_padding: data += '=' * missing_padding return base64.urlsafe_b64decode(data) # Parse arguments (in case this code runs as a script) if len(sys.argv) > 2 and sys.argv[1] == '-b': licenseServerUri = sys.argv[2] else: licenseServerUri = input('base64: ') # Decode the base64 string decoded_data = decode_base64(licenseServerUri).decode('utf-8') licenseServerdata = json.loads(decoded_data) # Iterate over keys in the JSON and print them keys = "" for key in licenseServerdata['keys']: kid = key['kid'] k = key['k'] keys += f"--key {decode_base64(kid).hex()}:{decode_base64(k).hex()} " # Print the result print(keys)
Code:main.py -b eyJrZXlzIjpbeyJrdHkiOiJvY3QiLCJhbGciOiJBMTI4S1ciLCJraWQiOiI2WURETVBLeVNTLWRoaTRRMjJscVJ3IiwiayI6IkNkU0dQZTRLUWlhcXJGdHB1anJQV2cifV19
Similar Threads
-
Modify stream PAR without reencoding
By bkqc in forum Video ConversionReplies: 28Last Post: 1st Dec 2022, 19:13 -
modify script
By filipino in forum Video Streaming DownloadingReplies: 6Last Post: 2nd Jan 2022, 19:06 -
Looking for Batch MP4 Normalization Script of existing script
By VideoFanatic in forum Video ConversionReplies: 6Last Post: 31st Jul 2021, 20:50 -
TapeName metadata how to modify ?
By chrisbati in forum Newbie / General discussionsReplies: 4Last Post: 24th Mar 2021, 23:52 -
Level() - And Why Does It Also Modify Chroma
By Okiba in forum RestorationReplies: 43Last Post: 14th Nov 2020, 09:42