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 23 of 23
  1. Encountered some problems and hope to get help .
    Got the PSSH from the kid in the mpd file, Blocking the URL and copying the data from the copy as curl (cmd) to get a new authorization bearer.

    The headers are also fully filled in, whether use getwvkeys.cc or the py script to return "Invalid auth token".
    The problem should lie in the one-time token requested by https://www.sokmil.com/purchase_auth/, not quite Sure
    Last edited by d9111; 21st Jan 2023 at 10:23.
    Quote Quote  
  2. sokmil need proper script
    not work on getwvkeys only ...
    Quote Quote  
  3. Originally Posted by lomero View Post
    sokmil need proper script
    not work on getwvkeys only ...
    Yes, I also used widevine_keys, both failed at authorization bearer.
    Quote Quote  
  4. I couldn't get the key with getwvkeys, so I installed pywidevine and changed the code from cdm.parse_license(session_id, licence.content) to cdm.parse_license(session_id, licence.json()['license']), and then I was able to parse the key!
    Quote Quote  
  5. Originally Posted by moco View Post
    I couldn't get the key with getwvkeys, so I installed pywidevine and changed the code from cdm.parse_license(session_id, licence.content) to cdm.parse_license(session_id, licence.json()['license']), and then I was able to parse the key!

    Thanks for your answer, unfortunately I don't know how to get the .wvd
    Quote Quote  
  6. Originally Posted by lomero View Post
    Yes I read it before replying to you, however I still haven't figured out how to get the .wvd
    Quote Quote  
  7. open main.py and edit on line 122 as explained on post#4

    Image
    [Attachment 70181 - Click to enlarge]
    Quote Quote  
  8. Originally Posted by lomero View Post
    open main.py and edit on line 122 as explained on post#4

    Image
    [Attachment 70181 - Click to enlarge]
    Thank you very much for answering again, in fact I have no idea how to use pywidevine!
    Quote Quote  
  9. Originally Posted by d9111 View Post
    in fact I have no idea how to use pywidevine!
    We neither!
    click click2
    If I/my posts ever helped you, and you want to give back, send me a private message!
    Quote Quote  
  10. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    create a wvd file which pywidevine uses to locate your CDM (Content Decryption Module). My command looked like this:-

    Code:
    pywidevine create-device -k /home/angela/Downloads/CDM-L3 2021-09/device_private_key -c /home/angela/Downloads/CDM-L3 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    So that is
    1. pywidevine-create-device
    2. -k <location of your cdm key>
    3. -c <location of your cdm blob>
    4. -t Android (specifies type)
    5. -l 3 (spcifies level)
    6. -o <save name>
    Then whenever using pywidevine you need to specify the location of the vwd file - either inside the script (if that is how it is setup) or when calling the script, for example:-
    Code:
    py c4-dl.py --download --wvd "samsung_sm-t819_6b0d43ba_4121_l3.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
    Quote Quote  
  11. Originally Posted by A_n_g_e_l_a View Post
    create a wvd file which pywidevine uses to locate your CDM (Content Decryption Module). My command looked like this:-

    Code:
    pywidevine create-device -k /home/angela/Downloads/CDM-L3 2021-09/device_private_key -c /home/angela/Downloads/CDM-L3 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    So that is
    1. pywidevine-create-device
    2. -k <location of your cdm key>
    3. -c <location of your cdm blob>
    4. -t Android (specifies type)
    5. -l 3 (spcifies level)
    6. -o <save name>
    Then whenever using pywidevine you need to specify the location of the vwd file - either inside the script (if that is how it is setup) or when calling the script, for example:-
    Code:
    py c4-dl.py --download --wvd "samsung_sm-t819_6b0d43ba_4121_l3.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
    HTML Code:
    pywidevine create-device -k /home/115/app 2021-09/device_private_key -c /home/115/app 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    I just changed the path and it reported an error.
    Error: Got unexpected extra arguments (2021-09/device_private_key 2021-09/device_client_id_blob)
    Quote Quote  
  12. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by d9111 View Post
    Originally Posted by A_n_g_e_l_a View Post
    create a wvd file which pywidevine uses to locate your CDM (Content Decryption Module). My command looked like this:-

    Code:
    pywidevine create-device -k /home/angela/Downloads/CDM-L3 2021-09/device_private_key -c /home/angela/Downloads/CDM-L3 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    So that is
    1. pywidevine-create-device
    2. -k <location of your cdm key>
    3. -c <location of your cdm blob>
    4. -t Android (specifies type)
    5. -l 3 (spcifies level)
    6. -o <save name>
    Then whenever using pywidevine you need to specify the location of the vwd file - either inside the script (if that is how it is setup) or when calling the script, for example:-
    Code:
    py c4-dl.py --download --wvd "samsung_sm-t819_6b0d43ba_4121_l3.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
    HTML Code:
    pywidevine create-device -k /home/115/app 2021-09/device_private_key -c /home/115/app 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    I just changed the path and it reported an error.
    Error: Got unexpected extra arguments (2021-09/device_private_key 2021-09/device_client_id_blob)
    your command will be the path to where you have your CDM's key and blob CDM-L3 2021-09 is on my computer and is my path to the key - not yours!! Follow the 1,2,3s and put your own values in.
    Quote Quote  
  13. Member
    Join Date
    Dec 2021
    Location
    england
    Search Comp PM
    easy way to create wvd file.
    create folder named folderA. copy device_private_key and device_client_id_blob into it. then enter folderA. create empty folderB inside folderA. open command prompt (cmd) and navigate to folderA. enter THIS EXACT COMMAND: pywidevine create-device -k device_private_key -c device_client_id_blob -t "ANDROID" -l 3 -o folderB
    Quote Quote  
  14. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by d9111 View Post
    Originally Posted by A_n_g_e_l_a View Post
    create a wvd file which pywidevine uses to locate your CDM (Content Decryption Module). My command looked like this:-

    Code:
    pywidevine create-device -k /home/angela/Downloads/CDM-L3 2021-09/device_private_key -c /home/angela/Downloads/CDM-L3 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    So that is
    1. pywidevine-create-device
    2. -k <location of your cdm key>
    3. -c <location of your cdm blob>
    4. -t Android (specifies type)
    5. -l 3 (spcifies level)
    6. -o <save name>
    Then whenever using pywidevine you need to specify the location of the vwd file - either inside the script (if that is how it is setup) or when calling the script, for example:-
    Code:
    py c4-dl.py --download --wvd "samsung_sm-t819_6b0d43ba_4121_l3.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
    HTML Code:
    pywidevine create-device -k /home/115/app 2021-09/device_private_key -c /home/115/app 2021-09/device_client_id_blob -t ANDROID -l 3 -o CDM2109.wvd
    I just changed the path and it reported an error.
    Error: Got unexpected extra arguments (2021-09/device_private_key 2021-09/device_client_id_blob)
    your command will be the path to where you have your CDM's key and blob CDM-L3 2021-09 is on my computer and is my path to the key - not yours!! Follow the 1,2,3s and put your own values in.


    Thanks for your help I tested it on bitmovin and it got the kid:key, but I failed on sokmil I changed line 122 as you said
    HTML Code:
    cdm.parse_license(session_id, licence.json()['license'])
    and then use
    HTML Code:
    PSSH: AAACmnBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnp6AgAAAQABAHACPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBnAE0AQwBDAFoAUwBwAGsARwBFAFMAZwBnADAARgB4AGEAaQA1AEEATABRAD0APQA8AC8ASwBJAEQAPgA8AEMASABFAEMASwBTAFUATQA+ADMAaQBVAFIATABsAEgANgAxAGYAQQA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAGUAbgBzAGUALgBjAGEAbgBkAGwALgBqAHAALwB2AGkAZABlAHgALwBwAGwAYQB5AHIAZQBhAGQAeQAvADwALwBMAEEAXwBVAFIATAA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4AAAAAiXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGkIARIQZYLAgGQqRBigg0Fxai5ALRoIY2FzdGxhYnMiQGV5SmhjM05sZEVsa0lqb2lOalU0TW1Nd09EQTJOREpoTkRReE9HRXdPRE0wTVRjeE5tRXlaVFF3TW1RaWZRPT0yB2RlZmF1bHQ=
    and
    HTML Code:
    license server URL: https://license.candl.jp/sokmil/widevine/
    Looks like I've got something wrong, so it fails!
    Quote Quote  
  15. because you use long pssh (wdv+PR)
    need to be converted

    try this one:
    Code:
    AAAAiXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGkIARIQZYLAgGQqRBigg0Fxai5ALRoIY2FzdGxhYnMiQGV5SmhjM05sZEVsa0lqb2lOalU0TW1Nd09EQTJOREpoTkRReE9HRXdPRE0wTVRjeE5tRXlaVFF3TW1RaWZRPT0yB2RlZmF1bHQ=
    Quote Quote  
  16. Originally Posted by lomero View Post
    because you use long pssh (wdv+PR)
    need to be converted

    try this one:
    Code:
    AAAAiXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGkIARIQZYLAgGQqRBigg0Fxai5ALRoIY2FzdGxhYnMiQGV5SmhjM05sZEVsa0lqb2lOalU0TW1Nd09EQTJOREpoTkRReE9HRXdPRE0wTVRjeE5tRXlaVFF3TW1RaWZRPT0yB2RlZmF1bHQ=
    Still not working, there seems to be a difference in the way sokmil requests.
    Quote Quote  
  17. my pssh is right
    have you tried with l3.py? this does not work for sokmil. need a proper script to get
    Quote Quote  
  18. You can get the key properly with this code.
    Code:
    # sokmil-auth.py
    
    import requests
    
    header = {
        "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
    }
    # Please search for the key "SCS" in Chrome's cookies and input its value here.
    cookie = {
        "SCS":"yourSCS",
    }
    
    authURL = "https://www.sokmil.com/purchase_auth/"
    
    payload = {
        "keyId" : "yourKID"
    }
    
    response = requests.post(
        url = authURL,
        headers = header,
        cookies = cookie,
        data = payload,
    )
    
    token = response.text
    
    print(token)
    Code:
    # getkeys.py
    
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    import requests
    # Please use the KID of the content that you want to download to generate a PSSH using this tool: https://tools.axinom.com/generators/PsshBox. Then, please enter the generated PSSH here.
    pssh = PSSH("yourPSSH")
    
    # load device
    device = Device.load(r"yourPATH")
    
    # load cdm
    cdm = Cdm.from_device(device)
    
    # open cdm session
    session_id = cdm.open()
    
    # get license challenge
    challenge = cdm.get_license_challenge(session_id, pssh)
    
    header = {
        "authorization" : "Bearer yourTOKEN",
        "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
    }
    
    licence = requests.post(
        url = "https://license.candl.jp/sokmil/widevine/",
        headers = header,
        data=challenge
    )
    
    licence.raise_for_status()
    
    # parse license challenge
    cdm.parse_license(session_id, licence.json()['license'])
    
    # print keys
    for key in cdm.get_keys(session_id):
        print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}")
    
    # close session, disposes of session data
    cdm.close(session_id)
    Quote Quote  
  19. Originally Posted by moco View Post
    You can get the key properly with this code.
    Code:
    # sokmil-auth.py
    
    import requests
    
    header = {
        "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
    }
    # Please search for the key "SCS" in Chrome's cookies and input its value here.
    cookie = {
        "SCS":"yourSCS",
    }
    
    authURL = "https://www.sokmil.com/purchase_auth/"
    
    payload = {
        "keyId" : "yourKID"
    }
    
    response = requests.post(
        url = authURL,
        headers = header,
        cookies = cookie,
        data = payload,
    )
    
    token = response.text
    
    print(token)
    Code:
    # getkeys.py
    
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    import requests
    # Please use the KID of the content that you want to download to generate a PSSH using this tool: https://tools.axinom.com/generators/PsshBox. Then, please enter the generated PSSH here.
    pssh = PSSH("yourPSSH")
    
    # load device
    device = Device.load(r"yourPATH")
    
    # load cdm
    cdm = Cdm.from_device(device)
    
    # open cdm session
    session_id = cdm.open()
    
    # get license challenge
    challenge = cdm.get_license_challenge(session_id, pssh)
    
    header = {
        "authorization" : "Bearer yourTOKEN",
        "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
    }
    
    licence = requests.post(
        url = "https://license.candl.jp/sokmil/widevine/",
        headers = header,
        data=challenge
    )
    
    licence.raise_for_status()
    
    # parse license challenge
    cdm.parse_license(session_id, licence.json()['license'])
    
    # print keys
    for key in cdm.get_keys(session_id):
        print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}")
    
    # close session, disposes of session data
    cdm.close(session_id)

    Thank you for your help, I made it, fantastic!
    Quote Quote  
  20. Thank you to everyone above who responded so enthusiastically.
    Quote Quote  
  21. Thanks for the script, trying to learn as best i can from all the input here, where do I locate my "payload = {"keyId" : "yourKID""? please and thank you.
    Quote Quote  
  22. Traceback (most recent call last):
    Last edited by jubojuru; 18th Jan 2024 at 03:46.
    Quote Quote  



Similar Threads

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