Hi,
I apologize for this newbie question:
How to get the keys for the channel 5 series Aerial Argentina - Season 1?
MPD links:
https://hwdash.channel5.com/cenc/C5447020001/C5447020001A/20221205181445/C5447020001A-tt.mpd
https://hwdash.channel5.com/cenc/C5447020002/C5447020002A/20221213025742/C5447020002A-tt.mpd
https://hwdash.channel5.com/cenc/C5447020003/C5447020003A/20221215033731/C5447020003A-tt.mpd
I know how to get the PSSH values.
But how to get the URL for the licence server?
Is e. g. https://cassie.channel5.com/api/v2/licences/widevine/332/C5447020001?expiry=xxxxx&tag=xxxxx the correct one?
+ Reply to Thread
Results 1 to 7 of 7
-
-
look for "auth" in the network tab
On the results, select the URL with the 'GET' Method
Look at the headers, you sould have something like
"authorization : Bearer something....."
That's the header you need to use on cdrm-project
If you look for 'Lic' in the network tab, you'll get the URL for the license field (that's the one with the ?expiry parameter") -
1448d7d0d17b4b7a83d8ff6aad4a57c8:3061128cbfa553a30 68d7b46cfcf25ab
678df23e004aff417896b5a20b93931c:3061128cbfa553a30 68d7b46cfcf25ab -
Code:
1448d7d0d17b4b7a83d8ff6aad4a57c8:3061128cbfa553a3068d7b46cfcf25ab 678df23e004aff417896b5a20b93931c:3061128cbfa553a3068d7b46cfcf25ab
-
Please anyone could help how to get license URL from this MPD can't find any I tried all combination lic auth DRM widevine...
-
I'm not sure what the problem is. CH5 is one of the easy ones (although shit quality). Play the video. Filter for mpd. Part way through the first advert you get the mpd. Stop the video. Filter for licence (or just lic). The licence is the one beginning with C
Typical for S01E01 of Aerial Argentina:
mpd:
https://akadash0.akamaized.net/cenc/C5447020001/C5447020001A/20221205181445/C5447020001A-tt.mpd
licence
https://cassie.channel5.com/api/v2/licences/widevine/332/C5447020001?expiry=1676717731...63323264613963
Here's my script for CH5 (also good for UKTV). It's designed to be used within WKS-KEYS folder, but you don't need the headers.py
Code:#### version 20230205-1 import os import base64 import requests from pywidevine.L3.cdm import deviceconfig from base64 import b64encode from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt import shutil import glob ##########useful when used within VS Code to tell it which directory you're in abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dname) ########## headers = { 'Accept': '*/*', 'Accept-Language': 'en-GB,en;q=0.9', 'Connection': 'keep-alive', } def cls(): # posix is os name for Linux or mac if(os.name == 'posix'): os.system('clear') # clear is the bash command # else screen will be cleared for windows (os name is actually nt for Windows) else: os.system('cls') # cls is the batch command def WV_Function(pssh, lic_url, cert_b64=None): wvdecrypt = WvDecrypt(init_data_b64=pssh, cert_data_b64=cert_b64, device=deviceconfig.device_android_generic) widevine_license = requests.post(url=lic_url, data=wvdecrypt.get_challenge(), headers=None) license_b64 = b64encode(widevine_license.content) wvdecrypt.update_license(license_b64) Correct, keyswvdecrypt = wvdecrypt.start_process() if Correct: return keyswvdecrypt def generate_pssh(mpd): division = mpd.split("cenc:pssh") for i in division: if i[1:5] == "AAAA": break pssh = i[1:-2] print(f"PSSH is {pssh}") return pssh def filename(): output_name = input("What do you want to call your final file? (do not include file .extension like .mp4) ") output_name = f"{output_name}.mp4" path = f"./Completed/{output_name}" # look to see if duplicate filename if os.path.isfile(path): print(f"\nyou already have a file called {output_name}. Choose another name\n") return filename() #look to see if any illegal characters in filename illegals = "@$%\/:*?\"<>|~`#^+=\{\};!" any_illegals = (set(output_name) & set(illegals)) if not any_illegals: return output_name else: list_illegals = ' '.join(any_illegals) print(f"\nyou have included the following which are not legal characters: {list_illegals}\n") return filename() cls() mpd_url = input("enter mpd URL: ") lic_url = input("\nenter licence URL: ") mpd = requests.get(mpd_url, headers = headers).text pssh = generate_pssh(mpd) #get KEY keys = WV_Function(pssh, lic_url) print("KID:KEY found is " + (keys[0])) keys = str(keys[0]) division = keys.find(":") key = (keys[division+1:]) print(f" KEY# is {key}") print("\n\n") os.system(f'yt-dlp --allow-u -f bestvideo -N 6 "{mpd_url}" -o encryptVid.mp4') os.system(f'yt-dlp --allow-u -f bestaudio -N 6 "{mpd_url}" -o encryptAud.m4a') print("==============================\n\n Decrypting\n\n==============================") os.system(f"mp4decrypt --show-progress --key 1:{key} encryptVid.mp4 video_decrypt.mp4") os.system(f"mp4decrypt --show-progress --key 1:{key} encryptAud.m4a audio_decrypt.m4a") if not os.path.exists("Throwaway"): os.makedirs("Throwaway") if not os.path.exists("Completed"): os.makedirs("Completed") cls() print("\n\n\n") output_name = filename() os.system(f"ffmpeg -i video_decrypt.mp4 -i audio_decrypt.m4a -c:v copy -c:a copy mux_file.mp4") os.rename("mux_file.mp4", f'{output_name}') shutil.move(f'{output_name}', "./Completed") for data in glob.glob("*_decrypt*.*"): shutil.move(data,"./Throwaway") for data in glob.glob("encrypt*.*"): shutil.move(data,"./Throwaway") shutil.rmtree("./Throwaway") print(f"All done.\n\n Your final file '{output_name}' is in 'Completed' folder")
Similar Threads
-
Does anyone know how to get the keys for channel 4 ?
By qwe199 in forum Video Streaming DownloadingReplies: 25Last Post: 15th Dec 2023, 23:39 -
Help with keys
By Braciata in forum Video Streaming DownloadingReplies: 5Last Post: 8th Jan 2023, 06:05 -
help in getting keys
By 10362227 in forum Video Streaming DownloadingReplies: 2Last Post: 28th Dec 2022, 22:45 -
Need Help in Getting Keys
By Game_Trips in forum Video Streaming DownloadingReplies: 6Last Post: 10th Oct 2022, 11:00 -
Can anyone help with getting keys?
By fisfisa in forum Video Streaming DownloadingReplies: 8Last Post: 1st Mar 2022, 00:33