VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. Member
    Join Date
    Jan 2024
    Location
    quahog
    Search PM
    Code:
    headers = {
        'accept': '*/*',
        'accept-language': 'en-US,en;q=0.9',
        'token': '<fastly expiring drm token >',
        'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': '"Windows"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'cross-site',
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
        'content-type': 'application/x-www-form-urlencoded',
    }
    
    data = '<browser cdm data>'
    Image
    [Attachment 76474 - Click to enlarge]

    License url,
    There is only 2 license requests (Method: OPTIONS and Method: POST).
    Only browser cdm data in the payload ( no widevineChallenge or any other data in the payload).
    Image
    [Attachment 76473 - Click to enlarge]



    with pywidevine
    Error:
    Code:
    500 internal server error
    I'm able to get the license response with WKS-KEYS
    Code:
     widevine_license = requests.post(url=lic_url, data=wvdecrypt.get_challenge(), headers=headers, proxies=proxies, auth=proxy_auth)
    License Response:
    Code:
    CAIS.................................
    but I can't extract the decryption keys from license response received from the License Server.
    I need help with this process.


    tried ,
    Code:
     
        license_b64 = b64encode(widevine_license.content)
        wvdecrypt.update_license(license_b64)
        Correct, keyswvdecrypt = wvdecrypt.start_process()
        if Correct:
            return Correct, keyswvdecrypt   
    correct, keys = WV_Function(pssh, lic_url)
    Error:
    Code:
    unable to parse license - check protobufs
    protobufs==3.19.5
    Quote Quote  
  2. usually this error due to headers problem
    Code:
    unable to parse license - check protobufs
    share video url
    Quote Quote  
  3. Try removing everything from the headers except the 'token'.
    Quote Quote  
  4. Member
    Join Date
    Jan 2024
    Location
    quahog
    Search PM
    didnt work. still unable to phrase
    Image
    [Attachment 76484 - Click to enlarge]



    Code:
    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=headers, proxies=proxies, auth=proxy_auth)
    
        print(f"\n[+] License Request: {widevine_license.request.body}")
        print(f"\n[+] License Response: {widevine_license.content}")
        license_b64 = b64encode(widevine_license.content)
        wvdecrypt.update_license(license_b64)
        Correct, keyswvdecrypt = wvdecrypt.start_process()
        if Correct:
            return Correct, keyswvdecrypt   
    correct, keys = WV_Function(pssh, lic_url)
    
    print()
    for key in keys:
        print('--key ' + key)
    Quote Quote  
  5. Search, Learn, Download! Karoolus's Avatar
    Join Date
    Oct 2022
    Location
    Belgium
    Search Comp PM
    Share the video URL so other people can try and see what needs to be done
    Quote Quote  
  6. Member
    Join Date
    Jan 2024
    Location
    quahog
    Search PM
    pm i can send access to video
    Quote Quote  
  7. Originally Posted by PETA View Post
    didnt work. still unable to phrase
    Image
    [Attachment 76484 - Click to enlarge]



    Code:
    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=headers, proxies=proxies, auth=proxy_auth)
    
        print(f"\n[+] License Request: {widevine_license.request.body}")
        print(f"\n[+] License Response: {widevine_license.content}")
        license_b64 = b64encode(widevine_license.content)
        wvdecrypt.update_license(license_b64)
        Correct, keyswvdecrypt = wvdecrypt.start_process()
        if Correct:
            return Correct, keyswvdecrypt   
    correct, keys = WV_Function(pssh, lic_url)
    
    print()
    for key in keys:
        print('--key ' + key)
    Your response is already in base64 so you just need a slight modification to your code
    replace this:
    Code:
    license_b64 = b64encode(widevine_license.content)
    with this:
    Code:
    license_b64 = widevine_license.content
    (or if that doesnt work, try this)
    Code:
    license_b64 = widevine_license.text
    Quote Quote  
  8. Member
    Join Date
    Jan 2024
    Location
    quahog
    Search PM
    Thanks it worked !

    removed everything from the headers except the 'token'
    replaced
    Code:
    license_b64 = widevine_license.content
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!