VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 8 of 8
  1. i have the code:

    def decrypt_keys():
    wvdecrypt = WvDecrypt(pssh)
    raw_challenge = wvdecrypt.get_challenge()
    challenge_b64 = b64encode(raw_challenge).decode()
    widevine_license = requests.post(
    url=lic_url, data=raw_challenge, headers=headers, timeout=10)
    license_b64 = b64encode(widevine_license.content)
    wvdecrypt.update_license(license_b64)
    keys = wvdecrypt.start_process()
    if keys:
    return keys
    keys = decrypt_keys()
    for key in keys:
    print("\n[green]+ [INFO] KEY: --key [/green]" + key)


    and the error when I get the keys is:

    for key in keys:
    TypeError: 'NoneType' object is not iterable

    Can someone help me fix the above error? Thanks!
    Quote Quote  
  2. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by googol View Post
    i have the code:

    def decrypt_keys():
    wvdecrypt = WvDecrypt(pssh)
    raw_challenge = wvdecrypt.get_challenge()
    challenge_b64 = b64encode(raw_challenge).decode()
    widevine_license = requests.post(
    url=lic_url, data=raw_challenge, headers=headers, timeout=10)
    license_b64 = b64encode(widevine_license.content)
    wvdecrypt.update_license(license_b64)
    keys = wvdecrypt.start_process()
    if keys:
    return keys
    keys = decrypt_keys()
    for key in keys:
    print("\n[green]+ [INFO] KEY: --key [/green]" + key)


    and the error when I get the keys is:

    for key in keys:
    TypeError: 'NoneType' object is not iterable

    Can someone help me fix the above error? Thanks!
    wvdecrypt returns a tuple containing an indicator of succes or otherwise and a list object containing keys.
    You are saying your keys are equal to the tuple
    Try this:
    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=None)
        license_b64 = b64encode(widevine_license.content)
        wvdecrypt.update_license(license_b64)
        Correct, keyswvdecrypt = wvdecrypt.start_process()
        # chain any multiple keys with --key at the start
        if Correct:
            mykeys = ''
            for key in keyswvdecrypt:
                mykeys += '--key' + key
        print(mykeys)
        return mykeys
    Quote Quote  
  3. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by googol View Post
    i have the code:

    def decrypt_keys():
    wvdecrypt = WvDecrypt(pssh)
    raw_challenge = wvdecrypt.get_challenge()
    challenge_b64 = b64encode(raw_challenge).decode()
    widevine_license = requests.post(
    url=lic_url, data=raw_challenge, headers=headers, timeout=10)
    license_b64 = b64encode(widevine_license.content)
    wvdecrypt.update_license(license_b64)
    keys = wvdecrypt.start_process()
    if keys:
    return keys
    keys = decrypt_keys()
    for key in keys:
    print("\n[green]+ [INFO] KEY: --key [/green]" + key)


    and the error when I get the keys is:

    for key in keys:
    TypeError: 'NoneType' object is not iterable

    Can someone help me fix the above error? Thanks!
    wvdecrypt returns a tuple containing an indicator of succes or otherwise and a list object containing keys.
    You are saying your keys are equal to the tuple
    Try this:
    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=None)
        license_b64 = b64encode(widevine_license.content)
        wvdecrypt.update_license(license_b64)
        Correct, keyswvdecrypt = wvdecrypt.start_process()
        # chain any multiple keys with --key at the start
        if Correct:
            mykeys = ''
            for key in keyswvdecrypt:
                mykeys += '--key' + key
        print(mykeys)
        return mykeys
    thank you, I tried your instructions, it doesn't give me any error but I also don't get the keys
    Quote Quote  
  4. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by googol View Post

    thank you, I tried your instructions, it doesn't give me any error but I also don't get the keys
    Then you have error elsewhere but not code errors as such. Probably something wrong with headers, pssh or the license. Who knows? It you check the value in 'Content' if it doesn't say 'Success' the cdm failed to do its job for some reason. Intercepting the command window in httptoolkit may give you more help. Or try sprinkling print(variable-name) statements throughout your code to make sure you've got what you're expecting at various stages.

    My code listed headers as none - you may need headers to your site so add this example header file
    Code:
    headers = {
        'Accept': '*/*',
        'Accept-Language': 'en-GB,en;q=0.7',
        'Connection': 'keep-alive',
    }
    and change headers=None in my original code to header=headers.

    But you may need to edit my minimal headers to whatever your curl of the license gives.
    Quote Quote  
  5. [QUOTE=A_n_g_e_l_a;2680881]
    Originally Posted by googol View Post
    .................
    But you may need to edit my minimal headers to whatever your curl of the license gives.
    Thank you! i tried again with wks-keys also failed to get the keys, which before wks-keys and that re-mod worked fine. i tried to get keys by getwvkeys got 4 keys but those keys are not viewable either. maybe that site has fixed the error already. (I don't speak English so I have to use google translate, hope you understand.)
    Quote Quote  
  6. - There is one more problem I hope you can help me with:

    I got a link but it contains tokens and only lasts a few hours like this:

    https://abc.xyz/MzIxNzg5MzR8azFzcG9ydDFmcGxfNzIwcC5zdHJc2MTc3MDIx/manifest.mpd

    Does anyone know how the php code automatically gets the link like this:

    http://mysite.xyz/manifest.mpd

    Thanks!
    Quote Quote  
  7. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by googol View Post

    Thank you! i tried again with wks-keys also failed to get the keys, which before wks-keys and that re-mod worked fine.
    That doesn't make much sense as you originally said you could not see any keys

    Originally Posted by googol View Post
    i tried to get keys by getwvkeys got 4 keys but those keys are not viewable either.
    GetVWKeys returned keys but you cannot see them?? How do you know keys were returned
    Originally Posted by googol View Post
    maybe that site has fixed the error already. (I don't speak English so I have to use google translate, hope you understand.)
    ??? not very well.

    Here is the bare minimum change to your original code
    Code:
    def decrypt_keys():
    wvdecrypt = WvDecrypt(pssh)
    raw_challenge = wvdecrypt.get_challenge()
    challenge_b64 = b64encode(raw_challenge).decode()
    widevine_license = requests.post(
    url=lic_url, data=raw_challenge, headers=headers, timeout=10)
    license_b64 = b64encode(widevine_license.content)
    wvdecrypt.update_license(license_b64)
    correct , keys = wvdecrypt.start_process()
    if correct:
        return keys
    
    
    keys = decrypt_keys()
    for key in keys:
    Quote Quote  
  8. Originally Posted by A_n_g_e_l_a View Post
    Here is the bare minimum change to your original code
    Code:
    def decrypt_keys():
    wvdecrypt = WvDecrypt(pssh)
    raw_challenge = wvdecrypt.get_challenge()
    challenge_b64 = b64encode(raw_challenge).decode()
    widevine_license = requests.post(
    url=lic_url, data=raw_challenge, headers=headers, timeout=10)
    license_b64 = b64encode(widevine_license.content)
    wvdecrypt.update_license(license_b64)
    correct , keys = wvdecrypt.start_process()
    if correct:
        return keys
    
    
    keys = decrypt_keys()
    for key in keys:
    .
    thanks bro, I will try it
    Quote Quote  



Similar Threads

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