Add files via upload

the option to obtain keys from the CDRM cache is added.
This commit is contained in:
Sasuke-Duck UwU 2023-11-16 01:50:49 -05:00 committed by GitHub
parent 8aa81bddf2
commit 36ab05dbee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View File

@ -873,6 +873,11 @@ def get_keys_license_cdrm_project(license_url, headers_license, pssh_value):
response = requests.post('https://cdrm-project.com/wv', json=json_data) response = requests.post('https://cdrm-project.com/wv', json=json_data)
return response return response
def get_keys_cache_cdrm_project(pssh_value):
data = pssh_value
response = requests.post('https://cdrm-project.com/findpssh', data=data)
print_keys_cdrm_project(response)
def print_keys_cdrm_project(response): def print_keys_cdrm_project(response):
if response.status_code == 200: if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser') soup = BeautifulSoup(response.text, 'html.parser')

35
cdrm_cache.py Normal file
View File

@ -0,0 +1,35 @@
import argparse
import requests
from cdm.wks import PsshExtractor, get_keys_cache_cdrm_project
def extract_pssh_value(mpd_url):
headers_mpd = {
'origin': 'https://play.hbomax.com',
'referer': 'https://play.hbomax.com/',
}
response = requests.get(mpd_url, headers=headers_mpd)
if response.status_code == 200:
pssh_extractor = PsshExtractor(response.text)
pssh_value = pssh_extractor.extract_pssh()
return pssh_value
else:
raise ValueError(f"Error: Unable to fetch MPD manifest, Status Code: {response.status_code}")
def main():
parser = argparse.ArgumentParser(description="Decrypt Widevine content using MPD URL and License URL")
parser.add_argument("-mpd", required=True, help="URL of the MPD manifest")
args = parser.parse_args()
mpd_url = args.mpd
try:
pssh_value = extract_pssh_value(mpd_url)
print("PSSH value:", pssh_value)
get_keys_cache_cdrm_project(pssh_value)
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
main()