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
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 62
  1. Member
    Join Date
    Feb 2024
    Location
    Turkey
    Search Comp PM
    Hello folks,

    I am trying to download a recap video from NBA.com. Here is the video link:

    https://www.nba.com/game/hou-vs-ind-0022300719%3Fwatch?watchRecap=true

    I prepared a script to send a POST request to the Widevine to obtain the key, here is the code:

    Code:
    import requests
    
    # Endpoint URL
    url = "https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license?ownerUid=azuki&mediaId=NBA_202402062235NBA_____VIDEOS__NBAE_2719841_Jitp_Reach_HD&sessionId=a9573095-b421-407c-9ab5-3470dce4affe&is_dvr=false"
    
    # Header
    headers = {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate, br",
        "Accept-Language": "en-US,en;q=0.9,tr;q=0.8,az;q=0.7",
        "ApplicationToken": "NBA_202402052236NBA_____VIDEOS__NBAE_2719496",
        "AuthorizationToken": "AuthToken1pVHbbtQwFPya5i0r3y8PeYjawlaooIqtFvHmy3ETNom3sdNt-Hrc0oKEACEhWcdH4zlzRp528T1MDpou52M6o-0ZeVPODMPaT3dHM-d1c5yjN5vJmk1-oG6Ii9-4OBZWdZXSAvMvsymnv4w8cX9SXQejSZvHcUjRHDdxvivoKZVCEOLlei69hyn3eS2tG0w_Pr1PZoRmSTUDF6jWrEZMuJoxaWuDJapxUMIG4wGsrXYwmSlf-cZDMMuQqwt46B0U4MuBP3R46uqoeKjpsuD6PmRdd8OIU75Hh0PUL-zdeoTmKqadsQPkqh2GeAL_Kp1-aN8mmIvyv3prnYvLszkqmfRSKw9YEotBBASYhGCRCRIZZbThgBSihlgGwRIbUDCAJBYyMB6Kz2cHLwb-W-63UY29m2OKIb8E-hqWegpL_CGsOQ7QpMUmN_cW5qpdchfn_qvJfZyuTTo0mGvMKKNccIxpMcyZ0pIQijVDQisihFKUYMa1UIRzzDERmiukleCIYEI1oQxhWnouCSOKY1EaVV0-HvsZ0oepKV-vleYa4ep8BpPBfwclwZIX8B2sb5feN04TyRlhNXDpaxY8r8tuqB1QL5VD3HFcba_b84_blnDRnJZPLsB2Pf-8bjF53-9vdx3f7_ubez5fKH2JT3Yr9C29oZdn1H8D",
        "AzukiIMC": "IMC7.2.0_AN_D3.0.0_S0",
        "Connection": "keep-alive",
        "Content-Length": "3992",
        "Content-Type": "text/plain",
        "Host": "ottapp-appgw-amp.nba.com",
        "Origin": "https://www.nba.com",
        "Referer": "https://www.nba.com/",
        "Sec-Fetch-Dest": "empty",
        "Sec-Fetch-Mode": "cors",
        "Sec-Fetch-Site": "same-site",
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "X-LocationDetails": '{"PostalCode":"06570","CountryCode":"TR"}',
        "sec-ch-ua": '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": '"macOS"',
        "DeviceProfile": "eyJtb2RlbCI6IkRlc2t0b3AiLCJvc1ZlcnNpb24iOiIxMC4xNS43IiwidmVuZG9yTmFtZSI6IkFwcGxlIiwib3NOYW1lIjoiSFRNTDUiLCJ3dkxldmVsIjoiTDMiLCJkZXZpY2VVVUlEIjoiNzdkNzc4MzBhNTU4NDdhN2I3NzY4ZGFkNjNiNTZkNGUifQ=="
    }
    
    pssh_data = b'\x00\x00\x00\x80pssh\x00\x00\x00\x00\xed\xef\x8b\xa9y\xd6J\xce\xa3\xc8\'\xdc\xd5\x1d!\xed\x00\x00\x00`\x08\x01\x12\x10\xb8\xab@(\x03\xbe\xb8\xe7\xbb\xcd\xca+\x8eh\xf5\x87\x1a\x0cmediakindnba":NBA_202402062235NBA_____VIDEOS__NBAE_2719841_Jitp_Reach_HD2\x00'
    
    response = requests.post(url, headers=headers, data=pssh_data)
    
    if response.status_code == 200:
        print("OK")
    else:
        print("NOT OK", response.status_code)
        print(response.content)
    PSSH before base64 obtained from EME Logger:
    Code:
    AAAAgHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGAIARIQuKtAKAO+uOe7zcorjmj1hxoMbWVkaWFraW5kbmJhIjpOQkFfMjAyNDAyMDYyMjM1TkJBX19fX19WSURFT1NfX05CQUVfMjcxOTg0MV9KaXRwX1JlYWNoX0hEMgA=
    I get the following error:

    Code:
    b'<error>\n  <checksum>567607f7018ab4f0932052f54bfcb19c</checksum>\n  <version>4.6.31.0.10</version>\n  <code>3313</code>\n  <az_err>1370</az_err>\n  <message>rights: Missing service collection ID</message>\n</error>\n'
    Thank you to all of you that trying to help, upfront!
    Quote Quote  
  2. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Code:
    --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e
    Does this work?
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  3. block the request url (without the session id in it) and reload
    the video won't play but you'll get the needed headers and the license url, so you can get the key that frog man gave you

    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Code:
    --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e
    Does this work?
    yes, it does
    click click2
    If I/my posts ever helped you, and you want to give back, send me a private message!
    Quote Quote  
  4. Member
    Join Date
    Feb 2024
    Location
    Turkey
    Search Comp PM
    Originally Posted by [ss]vegeta View Post
    block the request url (without the session id in it) and reload
    the video won't play but you'll get the needed headers and the license url, so you can get the key that frog man gave you
    I am good at coding, but I am a newbie on this DRM and this kind of stuff, so can you give more details about the procedure that you suggest
    Quote Quote  
  5. Member
    Join Date
    Feb 2024
    Location
    Turkey
    Search Comp PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Code:
    --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e
    Does this work?
    I sent this message via DM but I want to let others also know the process.

    Hello. It did not work, unfortunately. However, maybe, could be, there is a step that I'm missing.

    Here are the steps that I followed.

    I downloaded the video via the FetchV extension of Chrome(To make the download process more practical, I will be trying ffmpeg from now on)

    I uploaded the video to my Google drive you can check it from here: https://drive.google.com/file/d/17mlgLICY5uQ7qJ0CKN95MD1CPgHvT0Sz/view?usp=sharing

    Then I used the following code to decrypt the video:

    Code:
    mp4decrypt --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e game.mp4 gggg.mp4
    It outputs the same video.
    Last edited by doganjr; 9th Feb 2024 at 03:51.
    Quote Quote  
  6. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    I tested the key and it works. You can download the video from here: https://www.transfernow.net/en/bld?utm_source=20240207dhaXaWr4

    Now, what exactly went bad for you. I wouldn't say your script idea is wrong but it is incomplete. Just by looking at your imports, you are using only the requests library which is good, yeah, but it is not enough. If you want to write your own script that communicates with a Widevine license server you gotta understand the entire communication protocol. It's not enough to just send a pssh, and some headers, and be done, you get the keys. There's way more stuff going in the background regarding their protocol (this is why you get the error: rights: Missing service collection ID). But why would you try to reinvent the wheel? There are already existing implementations.

    One of them is pywidevine -> https://github.com/devine-dl/pywidevine

    If this is your first time I recommend you read from scratch the entire sticky threads. Angela and cedric offered some amazing explanations.
    The script I used is:

    Code:
    import requests
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    LICENSE_URL = "https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license?ownerUid=azuki&mediaId=NBA_202402062235NBA_____VIDEOS__NBAE_2719841_Jitp_Reach_HD&sessionId=a9573095-b421-407c-9ab5-3470dce4affe&is_dvr=false"
    PSSH_VALUE = "AAAAgHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGAIARIQuKtAKAO+uOe7zcorjmj1hxoMbWVkaWFraW5kbmJhIjpOQkFfMjAyNDAyMDYyMjM1TkJBX19fX19WSURFT1NfX05CQUVfMjcxOTg0MV9KaXRwX1JlYWNoX0hEMgA="
    WVD_FILE = "./device_wvd_file.wvd"
    
    LICENSE_HEADERS = {
        "AuthorizationToken": "AuthToken1pVHbbtQwFPya5i0r3y8PeYjawlaooIqtFvHmy3ETNom3sdNt-Hrc0oKEACEhWcdH4zlzRp528T1MDpou52M6o-0ZeVPODMPaT3dHM-d1c5yjN5vJmk1-oG6Ii9-4OBZWdZXSAvMvsymnv4w8cX9SXQejSZvHcUjRHDdxvivoKZVCEOLlei69hyn3eS2tG0w_Pr1PZoRmSTUDF6jWrEZMuJoxaWuDJapxUMIG4wGsrXYwmSlf-cZDMMuQqwt46B0U4MuBP3R46uqoeKjpsuD6PmRdd8OIU75Hh0PUL-zdeoTmKqadsQPkqh2GeAL_Kp1-aN8mmIvyv3prnYvLszkqmfRSKw9YEotBBASYhGCRCRIZZbThgBSihlgGwRIbUDCAJBYyMB6Kz2cHLwb-W-63UY29m2OKIb8E-hqWegpL_CGsOQ7QpMUmN_cW5qpdchfn_qvJfZyuTTo0mGvMKKNccIxpMcyZ0pIQijVDQisihFKUYMa1UIRzzDERmiukleCIYEI1oQxhWnouCSOKY1EaVV0-HvsZ0oepKV-vleYa4ep8BpPBfwclwZIX8B2sb5feN04TyRlhNXDpaxY8r8tuqB1QL5VD3HFcba_b84_blnDRnJZPLsB2Pf-8bjF53-9vdx3f7_ubez5fKH2JT3Yr9C29oZdn1H8D",
        "AzukiIMC": "IMC7.2.0_AN_D3.0.0_S0",
        "DeviceProfile": "eyJtb2RlbCI6IkRlc2t0b3AiLCJvc1ZlcnNpb24iOiIxMC4xNS43IiwidmVuZG9yTmFtZSI6IkFwcGxlIiwib3NOYW1lIjoiSFRNTDUiLCJ3dkxldmVsIjoiTDMiLCJkZXZpY2VVVUlEIjoiNzdkNzc4MzBhNTU4NDdhN2I3NzY4ZGFkNjNiNTZkNGUifQ=="
    }
    
    pssh = PSSH(PSSH_VALUE)
    device = Device.load(WVD_FILE)
    cdm = Cdm.from_device(device)
    session_id = cdm.open()
    challenge = cdm.get_license_challenge(session_id, pssh)
    
    licence = requests.post(LICENSE_URL, headers=LICENSE_HEADERS, data=challenge)
    licence.raise_for_status()
    
    cdm.parse_license(session_id, licence.content)
    for key in cdm.get_keys(session_id):
        print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}")
    cdm.close(session_id)
    You gotta get your own CDM (the wvd magic file). I don't recommend downloading the first one you find on the internet since 99.99% of those are already revoked. Using the previous script, I got the mentioned key. If you don't want to bother with your own CDM, then you can use https://cdrm-project.com/
    Then using that key you can download the video. Use the stream detector. Get the index m3u8 link and copy it as a N_m3u8 command.

    Image
    [Attachment 76839 - Click to enlarge]


    Open the CMD or bash or whatever, and paste that command. To that command add the following:
    Code:
    -M format=mkv --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e
    And that's it. The video is downloaded and decrypted.

    Image
    [Attachment 76840 - Click to enlarge]


    Originally Posted by [ss]vegeta View Post
    yes, it does
    Oops, didn't notice the comment. Thanks for confirming.
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 7th Feb 2024 at 07:59.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  7. Member
    Join Date
    Jun 2023
    Location
    Añañañay
    Search Comp PM
    [QUOTE=2nHxWW6GkN1l916N3ayz8HQoi;2723165]

    If this is your first time I recommend you read from scratch the entire sticky threads. Angela and cedric offered some amazing explanations.
    The script I used is:

    Code:
    import requests
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    LICENSE_URL = "https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license?ownerUid=azuki&mediaId=NBA_202402062235NBA_____VIDEOS__NBAE_2719841_Jitp_Reach_HD&sessionId=a9573095-b421-407c-9ab5-3470dce4affe&is_dvr=false"
    PSSH_VALUE = "AAAAgHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGAIARIQuKtAKAO+uOe7zcorjmj1hxoMbWVkaWFraW5kbmJhIjpOQkFfMjAyNDAyMDYyMjM1TkJBX19fX19WSURFT1NfX05CQUVfMjcxOTg0MV9KaXRwX1JlYWNoX0hEMgA="
    WVD_FILE = "./device_wvd_file.wvd"
    
    LICENSE_HEADERS = {
        "AuthorizationToken": "AuthToken1pVHbbtQwFPya5i0r3y8PeYjawlaooIqtFvHmy3ETNom3sdNt-Hrc0oKEACEhWcdH4zlzRp528T1MDpou52M6o-0ZeVPODMPaT3dHM-d1c5yjN5vJmk1-oG6Ii9-4OBZWdZXSAvMvsymnv4w8cX9SXQejSZvHcUjRHDdxvivoKZVCEOLlei69hyn3eS2tG0w_Pr1PZoRmSTUDF6jWrEZMuJoxaWuDJapxUMIG4wGsrXYwmSlf-cZDMMuQqwt46B0U4MuBP3R46uqoeKjpsuD6PmRdd8OIU75Hh0PUL-zdeoTmKqadsQPkqh2GeAL_Kp1-aN8mmIvyv3prnYvLszkqmfRSKw9YEotBBASYhGCRCRIZZbThgBSihlgGwRIbUDCAJBYyMB6Kz2cHLwb-W-63UY29m2OKIb8E-hqWegpL_CGsOQ7QpMUmN_cW5qpdchfn_qvJfZyuTTo0mGvMKKNccIxpMcyZ0pIQijVDQisihFKUYMa1UIRzzDERmiukleCIYEI1oQxhWnouCSOKY1EaVV0-HvsZ0oepKV-vleYa4ep8BpPBfwclwZIX8B2sb5feN04TyRlhNXDpaxY8r8tuqB1QL5VD3HFcba_b84_blnDRnJZPLsB2Pf-8bjF53-9vdx3f7_ubez5fKH2JT3Yr9C29oZdn1H8D",
        "AzukiIMC": "IMC7.2.0_AN_D3.0.0_S0",
        "DeviceProfile": "eyJtb2RlbCI6IkRlc2t0b3AiLCJvc1ZlcnNpb24iOiIxMC4xNS43IiwidmVuZG9yTmFtZSI6IkFwcGxlIiwib3NOYW1lIjoiSFRNTDUiLCJ3dkxldmVsIjoiTDMiLCJkZXZpY2VVVUlEIjoiNzdkNzc4MzBhNTU4NDdhN2I3NzY4ZGFkNjNiNTZkNGUifQ=="
    }
    
    pssh = PSSH(PSSH_VALUE)
    device = Device.load(WVD_FILE)
    cdm = Cdm.from_device(device)
    session_id = cdm.open()
    challenge = cdm.get_license_challenge(session_id, pssh)
    
    licence = requests.post(LICENSE_URL, headers=LICENSE_HEADERS, data=challenge)
    licence.raise_for_status()
    
    cdm.parse_license(session_id, licence.content)
    for key in cdm.get_keys(session_id):
        print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}")
    cdm.close(session_id)
    Hello Im trying to get the key to decrypt videos of Leaguepass, inspired by your post, but Im getting this error

    Code:
    Error 403: <error> <checksum>8ccf6289f610170a25fa49f6f7f04d73</checksum> <version>4.6.33.0.12</version> <code>7027</code> <az_err>1554</az_err> <message>out of country blocked because client is neither in home country nor in content portability region</message> </error>

    could you explain me why I hace that error?

    regards
    Quote Quote  
  8. Member
    Join Date
    Jun 2023
    Location
    Añañañay
    Search Comp PM
    Why is showing me this error

    Code:
    Error 403: <error> <checksum>8ccf6289f610170a25fa49f6f7f04d73</checksum> <version>4.6.33.0.12</version> <code>7027</code> <az_err>1554</az_err> <message>out of country blocked because client is neither in home country nor in content portability region</message> </error>
    Quote Quote  
  9. the error told you, geo block. so use US vpn.
    Quote Quote  
  10. I'm getting the same error on cdrm-project.com but I'm successfully getting keys with WKS.
    The video plays fine without VPN and I'm from a shithole country in Europe.
    So probably the CDM used by cdrm-project.com got banned for NBA?
    click click2
    If I/my posts ever helped you, and you want to give back, send me a private message!
    Quote Quote  
  11. Member
    Join Date
    Sep 2022
    Location
    United Kingdom
    Search Comp PM
    NBA League Pass is not geo locked because it's available in over 200 countries...
    Quote Quote  
  12. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    I am also in this situation, how to solve it?
    Quote Quote  
  13. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by [ss]vegeta View Post
    I'm getting the same error on cdrm-project.com but I'm successfully getting keys with WKS.
    The video plays fine without VPN and I'm from a shithole country in Europe.
    So probably the CDM used by cdrm-project.com got banned for NBA?
    I try to use another NBA video using cdrm-project.com and http://108.181.133.95:8080/ are 403 results Can you help me?
    Quote Quote  
  14. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Here is the downloader for nba.com. It can only be used for free videos (with and without an account, and also both classic videos and game recaps).

    Code:
    import json
    import re
    import urllib.parse
    
    import requests
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    AZUKI_IMC = "IMC7.2.0_AN_D3.0.0_S0"
    DEVICE_PROFILE = "eyJtb2RlbCI6IkRlc2t0b3AiLCJvc1ZlcnNpb24iOiIxMCIsInZlbmRvck5hbWUiOiJNaWNyb3NvZnQiLCJvc05hbWUiOiJIVE1MNSIsInd2TGV2ZWwiOiJMMyIsImRldmljZVVVSUQiOiJkZXZpY2VVVUlEIn0="
    EMAIL = 'YOUR_EMAIL'
    PASSWORD = 'YOUR_PASSWORD'
    
    NBA_PLAY_OPTIONS = 'https://ottapp-appgw-client.nba.com/S1/subscriber/{path}/{program_id}/play-options'
    NBA_ROLL = 'https://ottapp-appgw-amp.nba.com/v1/client/roll'
    NBA_API_STS = 'https://identity.nba.com/api/v1/sts'
    NBA_API_AUTH = 'https://identity.nba.com/api/v1/auth'
    
    LICENSE_URL = "https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license"
    WVD_FILE = "./device_wvd_file.wvd"
    
    
    def get_pssh_info(base_uri, manifest_uri):
        manifest = f"{base_uri}/{manifest_uri}" + '&sessionId=sessionId'
        v_m3u8 = re.findall(r'^v.*?\.m3u8\?.*?$', requests.get(manifest).content.decode(), re.MULTILINE)[-1]
        v_m3u8 = f"{base_uri}/{manifest_uri.replace('index.m3u8', v_m3u8)}"
        pssh = re.search(r'base64,([^"]+)"', requests.get(v_m3u8).content.decode()).group(1)
        return manifest, pssh
    
    
    def get_program_info(source_url):
        if "/video/" in source_url:
            return "v3/programs", re.findall(
                r'"mediakindExternalProgramId":"([^"]*)"', requests.get(source_url).content.decode()
            )[0]
        if "/game/" in source_url:
            return "v2/events", max(re.findall(r'\d+', source_url), key=len)
        return None, None
    
    
    def get_auth_token():
        for info in [EMAIL, PASSWORD]:
            if info is None or len(info) == 0:
                return json.loads(requests.get(NBA_API_STS).content.decode())["data"]["AccessToken"]
        response = json.loads(requests.post(
            NBA_API_AUTH, json={'email': EMAIL, 'password': PASSWORD}
        ).content.decode())["data"]
    
        nba_identity = urllib.parse.quote(json.dumps(
            {"jwt": response["jwt"], "refreshToken": response["refreshToken"]}
        ))
        return json.loads(requests.get(
            NBA_API_STS, cookies={'nbaidentity': nba_identity}
        ).content.decode())["data"]["AccessToken"]
    
    
    AUTH_TOKEN = get_auth_token()
    
    
    def get_video_data(source_url):
        path, program_id = get_program_info(source_url)
        response = requests.get(
            NBA_PLAY_OPTIONS.format(path=path, program_id=program_id),
            headers={'Authorization': f'OAUTH2 access_token="{AUTH_TOKEN}"'},
            params={'IsexternalId': 'true'}
        ).content.decode()
    
        matches = re.findall(r'"Id":"([^"]*)"', response)
        vod_id = sorted(
            [r for r in matches if "VIDEO" in r] if "VIDEO" in str(matches) else matches,
            key=len, reverse=True
        )[0]
    
        response = json.loads(requests.post(
            NBA_ROLL, data="{}",
            params={'ownerUid': 'azuki', 'mediaId': vod_id, 'sessionId': 'sessionId'},
            headers={'AuthorizationToken': AUTH_TOKEN, 'AzukiIMC': AZUKI_IMC, 'DeviceProfile': DEVICE_PROFILE},
        ).content.decode())
    
        manifest, pssh = get_pssh_info(
            response["response"]["cdns"]["cdn"][0]["base_uri"],
            response["response"]["manifest_uri"],
        )
        return manifest, pssh, vod_id
    
    
    def get_keys(pssh_value, vod_id):
        if pssh_value is None or vod_id is None:
            return []
    
        pssh = PSSH(pssh_value)
        device = Device.load(WVD_FILE)
        cdm = Cdm.from_device(device)
        cdm_session_id = cdm.open()
        challenge = cdm.get_license_challenge(cdm_session_id, pssh)
    
        licence = requests.post(
            LICENSE_URL, data=challenge,
            headers={"AuthorizationToken": AUTH_TOKEN, 'DeviceProfile': DEVICE_PROFILE, 'AzukiIMC': AZUKI_IMC},
            params={"ownerUid": "azuki", "mediaId": vod_id, "sessionId": "sessionId"}
        )
        licence.raise_for_status()
        cdm.parse_license(cdm_session_id, licence.content)
    
        keys = []
        for key in cdm.get_keys(cdm_session_id):
            if "CONTENT" in key.type:
                keys += [f"{key.kid.hex}:{key.key.hex()}"]
        cdm.close(cdm_session_id)
        return keys
    
    
    def get_download_command(source_url):
        manifest, pssh_value, vod_id = get_video_data(source_url)
        keys = get_keys(pssh_value, vod_id)
    
        if len(keys) == 0:
            return f"N_m3u8DL-RE.exe {manifest} -M format=mkv"
        return f'N_m3u8DL-RE.exe "{manifest}" {" ".join([f"--key {k}" for k in keys])} -M format=mkv'
    
    
    SOURCE_URLS = [
        # Without account
        "https://www.nba.com/watch/video/game-recap-lakers-120-timberwolves-109",
        "https://www.nba.com/watch/video/the-fast-break-mar-10-2",
        "https://www.nba.com/watch/video/game-recap-wizards-110-heat-108",
        "https://www.nba.com/game/hou-vs-ind-0022300719?watchRecap=true",
        "https://www.nba.com/game/mil-vs-lac-0022300924?watchRecap=true",
        "https://www.nba.com/game/ind-vs-orl-0022300928?watchRecap=true",
        # With (free) account
        "https://www.nba.com/watch/video/2016-dunk-contest-lavine-vs-gordon-best-ever",
        "https://www.nba.com/watch/video/2-27-2023-banchero-takes-over-in-clutch-vs-pels",
        "https://www.nba.com/watch/video/12-7-23-haliburton-shines-in-in-season-tournament",
    ]
    for s in SOURCE_URLS:
        print(get_download_command(s))
    Output:
    Code:
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403110042NBA_____VIDEOS__NBAE_2730310/index.m3u8?addUserInfo=1&sessionId=sessionId" --key 5ebee3c8d5e10606e92be5bb4fad2dab:80f3b559dedfcba9092fff0abf666aad -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_436C1F6E-DF62-11EE-967D-3CFDFEE7DB71/index.m3u8?addUserInfo=1&sessionId=sessionId" --key 843e4a9d08bab7caa44ba37d33b08201:b02e50d244af1e211edc730b15f56b6a -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403102202NBA_____VIDEOS__NBAE_2730223/index.m3u8?addUserInfo=1&sessionId=sessionId" --key 13701f9eefda552a1dcb4043a14e899c:8096b4a869983f8fa775787fbda20669 -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202402062235NBA_____VIDEOS__NBAE_2719841/index.m3u8?addUserInfo=1&sessionId=sessionId" --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403101839NBA_____VIDEOS__NBAE_2730064/index.m3u8?addUserInfo=1&sessionId=sessionId" --key a28f78780df93c40c3537bef7423b38e:b6436ef1665c8474d48c943440ee5303 -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403102200NBA_____VIDEOS__NBAE_2730212/index.m3u8?addUserInfo=1&sessionId=sessionId" --key f81eb304966d19d02bd90d27522ff25d:11cfe5b53309cfb500c47db09ad7dc82 -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202301290937NBA_____VIDEOS__NBAE_2630941/index.m3u8?addUserInfo=1&sessionId=sessionId" --key 964f42e46638932b33427461f136459f:06ee868164f7d156637fde3fa500a671 -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202401301756NBA_____VIDEOS__NBAE_2717587/index.m3u8?addUserInfo=1&sessionId=sessionId" --key 6eb0a05cb4fe3dd565df106a02d2419c:eb8f629dc8354f593ce2059a12a75a0b -M format=mkv
    N_m3u8DL-RE.exe "https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202402121203NBA_____VIDEOS__NBAE_2721586/index.m3u8?addUserInfo=1&sessionId=sessionId" --key b7866579c32ff24d52882fe194a2ac99:f9fe7b15d02deca76749b80963e68252 -M format=mkv
    Their login functionality was implemented in a good way, which was a nice thing to see. The easy solution was to simply use the browser cookies to skip that. So if you want free videos that need a free account to watch, make one and log in using the Firefox browser (and make sure the browser cookies don't get deleted).

    Also, their API was kinda inconsistent in some responses so the script may not work for the rare video once in a while. Regardless, if there are problems, just leave a message here and I may take a look.

    Edit: Seems I kinda praised their login functionality a bit too much. Now the script works fully programmatically without needing to check for existing browser cookies. If you have an account just fill in your email and password. If you just want videos without needing a free account, just make the EMAIL and PASSWORD variables empty strings (the script will obviously fail then if you attempt to download account-required videos).

    Edit2: I've seen that some users needed a US VPN. So if something fails, I guess try with that.

    Edit3: The m3u8 files have now a sessionId query parameter. You get 400 without one.

    Edit4: This script has been added and extended in the widefrog tool so I won't maintain it here. Any relevant updates will take place in the support thread.
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 21st May 2024 at 04:24.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  15. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Here is the downloader for nba.com. It can only be used for free videos (with and without an account, and also both classic videos and game recaps).

    Their login functionality was implemented in a good way, which was a nice thing to see. The easy solution was to simply use the browser cookies to skip that. So if you want free videos that need a free account to watch, make one and log in using the Firefox browser (and make sure the browser cookies don't get deleted).

    Also, their API was kinda inconsistent in some responses so the script may not work for the rare video once in a while. Regardless, if there are problems, just leave a message here and I may take a look.
    Well done once again.
    Quote Quote  
  16. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Here is the downloader for nba.com. It can only be used for free videos (with and without an account, and also both classic videos and game recaps).

    Code:
    import json
    import re
    
    import browser_cookie3
    import requests
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    AZUKI_IMC = "IMC7.2.0_AN_D3.0.0_S0"
    DEVICE_PROFILE = "eyJtb2RlbCI6IkRlc2t0b3AiLCJvc1ZlcnNpb24iOiIxMCIsInZlbmRvck5hbWUiOiJNaWNyb3NvZnQiLCJvc05hbWUiOiJIVE1MNSIsInd2TGV2ZWwiOiJMMyIsImRldmljZVVVSUQiOiJkZXZpY2VVVUlEIn0="
    
    NBA_PLAY_OPTIONS = 'https://ottapp-appgw-client.nba.com/S1/subscriber/{path}/{program_id}/play-options'
    NBA_ROLL = 'https://ottapp-appgw-amp.nba.com/v1/client/roll'
    NBA_API_STS = 'https://identity.nba.com/api/v1/sts'
    
    LICENSE_URL = "https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license"
    WVD_FILE = "./device_wvd_file.wvd"
    
    
    def get_pssh_info(base_uri, manifest_uri):
        manifest = f"{base_uri}/{manifest_uri}"
        v_m3u8 = re.findall(r'^v.*?\.m3u8\?.*?$', requests.get(manifest).content.decode(), re.MULTILINE)[-1]
        v_m3u8 = f"{base_uri}/{manifest_uri.replace("index.m3u8", v_m3u8)}"
        pssh = re.search(r'base64,([^"]+)"', requests.get(v_m3u8).content.decode()).group(1)
        return manifest, pssh
    
    
    def get_program_info(source_url):
        if "/video/" in source_url:
            return "v3/programs", re.findall(
                r'"mediakindExternalProgramId":"([^"]*)"', requests.get(source_url).content.decode()
            )[0]
        if "/game/" in source_url:
            return "v2/events", max(re.findall(r'\d+', source_url), key=len)
        return None, None
    
    
    def get_auth_token():
        for c in browser_cookie3.firefox(domain_name='nba.com'):
            if "mediakindauth2token" in str(c):
                return c.value
        return json.loads(requests.get(NBA_API_STS).content.decode())["data"]["AccessToken"]
    
    
    AUTH_TOKEN = get_auth_token()
    
    
    def get_video_data(source_url):
        path, program_id = get_program_info(source_url)
        response = requests.get(
            NBA_PLAY_OPTIONS.format(path=path, program_id=program_id),
            headers={'Authorization': f'OAUTH2 access_token="{AUTH_TOKEN}"'},
            params={'IsexternalId': 'true'}
        ).content.decode()
    
        matches = re.findall(r'"Id":"([^"]*)"', response)
        vod_id = sorted(
            [r for r in matches if "VIDEO" in r] if "VIDEO" in str(matches) else matches,
            key=len, reverse=True
        )[0]
    
        response = json.loads(requests.post(
            NBA_ROLL, data="{}",
            params={'ownerUid': 'azuki', 'mediaId': vod_id, 'sessionId': 'sessionId'},
            headers={'AuthorizationToken': AUTH_TOKEN, 'AzukiIMC': AZUKI_IMC, 'DeviceProfile': DEVICE_PROFILE},
        ).content.decode())
    
        manifest, pssh = get_pssh_info(
            response["response"]["cdns"]["cdn"][0]["base_uri"],
            response["response"]["manifest_uri"],
        )
        return manifest, pssh, vod_id
    
    
    def get_keys(pssh_value, vod_id):
        if pssh_value is None or vod_id is None:
            return []
    
        pssh = PSSH(pssh_value)
        device = Device.load(WVD_FILE)
        cdm = Cdm.from_device(device)
        cdm_session_id = cdm.open()
        challenge = cdm.get_license_challenge(cdm_session_id, pssh)
    
        licence = requests.post(
            LICENSE_URL, data=challenge,
            headers={"AuthorizationToken": AUTH_TOKEN, 'DeviceProfile': DEVICE_PROFILE, 'AzukiIMC': AZUKI_IMC},
            params={"ownerUid": "azuki", "mediaId": vod_id, "sessionId": "sessionId"}
        )
        licence.raise_for_status()
        cdm.parse_license(cdm_session_id, licence.content)
    
        keys = []
        for key in cdm.get_keys(cdm_session_id):
            if "CONTENT" in key.type:
                keys += [f"{key.kid.hex}:{key.key.hex()}"]
        cdm.close(cdm_session_id)
        return keys
    
    
    def get_download_command(source_url):
        manifest, pssh_value, vod_id = get_video_data(source_url)
        keys = get_keys(pssh_value, vod_id)
    
        if len(keys) == 0:
            return f"N_m3u8DL-RE.exe {manifest} -M format=mkv"
        return f"N_m3u8DL-RE.exe {manifest} {' '.join([f'--key {k}' for k in keys])} -M format=mkv"
    
    
    SOURCE_URLS = [
        # Without account
        "https://www.nba.com/watch/video/game-recap-lakers-120-timberwolves-109",
        "https://www.nba.com/watch/video/the-fast-break-mar-10-2",
        "https://www.nba.com/watch/video/game-recap-wizards-110-heat-108",
        "https://www.nba.com/game/hou-vs-ind-0022300719?watchRecap=true",
        "https://www.nba.com/game/mil-vs-lac-0022300924?watchRecap=true",
        "https://www.nba.com/game/ind-vs-orl-0022300928?watchRecap=true",
        # With (free) account
        "https://www.nba.com/watch/video/2016-dunk-contest-lavine-vs-gordon-best-ever",
        "https://www.nba.com/watch/video/2-27-2023-banchero-takes-over-in-clutch-vs-pels",
        "https://www.nba.com/watch/video/12-7-23-haliburton-shines-in-in-season-tournament",
    ]
    for s in SOURCE_URLS:
        print(get_download_command(s))
    Output:
    Code:
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403110042NBA_____VIDEOS__NBAE_2730310/index.m3u8?addUserInfo=1 --key 5ebee3c8d5e10606e92be5bb4fad2dab:80f3b559dedfcba9092fff0abf666aad -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_436C1F6E-DF62-11EE-967D-3CFDFEE7DB71/index.m3u8?addUserInfo=1 --key 843e4a9d08bab7caa44ba37d33b08201:b02e50d244af1e211edc730b15f56b6a -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403102202NBA_____VIDEOS__NBAE_2730223/index.m3u8?addUserInfo=1 --key 13701f9eefda552a1dcb4043a14e899c:8096b4a869983f8fa775787fbda20669 -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202402062235NBA_____VIDEOS__NBAE_2719841/index.m3u8?addUserInfo=1 --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403101839NBA_____VIDEOS__NBAE_2730064/index.m3u8?addUserInfo=1 --key a28f78780df93c40c3537bef7423b38e:b6436ef1665c8474d48c943440ee5303 -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202403102200NBA_____VIDEOS__NBAE_2730212/index.m3u8?addUserInfo=1 --key f81eb304966d19d02bd90d27522ff25d:11cfe5b53309cfb500c47db09ad7dc82 -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202301290937NBA_____VIDEOS__NBAE_2630941/index.m3u8?addUserInfo=1 --key 964f42e46638932b33427461f136459f:06ee868164f7d156637fde3fa500a671 -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202401301756NBA_____VIDEOS__NBAE_2717587/index.m3u8?addUserInfo=1 --key 6eb0a05cb4fe3dd565df106a02d2419c:eb8f629dc8354f593ce2059a12a75a0b -M format=mkv
    N_m3u8DL-RE.exe https://nbalpng.akamaized.net/vod-pz/a/hls-wvpr/NBA_202402121203NBA_____VIDEOS__NBAE_2721586/index.m3u8?addUserInfo=1 --key b7866579c32ff24d52882fe194a2ac99:f9fe7b15d02deca76749b80963e68252 -M format=mkv
    Their login functionality was implemented in a good way, which was a nice thing to see. The easy solution was to simply use the browser cookies to skip that. So if you want free videos that need a free account to watch, make one and log in using the Firefox browser (and make sure the browser cookies don't get deleted).

    Also, their API was kinda inconsistent in some responses so the script may not work for the rare video once in a while. Regardless, if there are problems, just leave a message here and I may take a look.
    I have a problem

    import browser_cookie3
    ModuleNotFoundError: No module named 'browser_cookie3'

    How to solve it?
    Quote Quote  
  17. Code:
    pip install browser_cookie3
    Quote Quote  
  18. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by ElCap View Post
    Code:
    pip install browser_cookie3
    A new code error occurs after running

    File "/Users/czm/Downloads/m3u8tools/pywidevine-master/pywidevine/nbadl.py", line 125, in <module>
    print(get_download_command(s))
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/czm/Downloads/m3u8tools/pywidevine-master/pywidevine/nbadl.py", line 103, in get_download_command
    manifest, pssh_value, vod_id = get_video_data(source_url)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/czm/Downloads/m3u8tools/pywidevine-master/pywidevine/nbadl.py", line 70, in get_video_data
    response["response"]["cdns"]["cdn"][0]["base_uri"],
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^
    KeyError: 'cdns'
    Quote Quote  
  19. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    I tested the key and it works. You can download the video from here: https://www.transfernow.net/en/bld?utm_source=20240207dhaXaWr4

    Now, what exactly went bad for you. I wouldn't say your script idea is wrong but it is incomplete. Just by looking at your imports, you are using only the requests library which is good, yeah, but it is not enough. If you want to write your own script that communicates with a Widevine license server you gotta understand the entire communication protocol. It's not enough to just send a pssh, and some headers, and be done, you get the keys. There's way more stuff going in the background regarding their protocol (this is why you get the error: rights: Missing service collection ID). But why would you try to reinvent the wheel? There are already existing implementations.

    One of them is pywidevine -> https://github.com/devine-dl/pywidevine

    If this is your first time I recommend you read from scratch the entire sticky threads. Angela and cedric offered some amazing explanations.
    The script I used is:

    Code:
    import requests
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    LICENSE_URL = "https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license?ownerUid=azuki&mediaId=NBA_202402062235NBA_____VIDEOS__NBAE_2719841_Jitp_Reach_HD&sessionId=a9573095-b421-407c-9ab5-3470dce4affe&is_dvr=false"
    PSSH_VALUE = "AAAAgHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAGAIARIQuKtAKAO+uOe7zcorjmj1hxoMbWVkaWFraW5kbmJhIjpOQkFfMjAyNDAyMDYyMjM1TkJBX19fX19WSURFT1NfX05CQUVfMjcxOTg0MV9KaXRwX1JlYWNoX0hEMgA="
    WVD_FILE = "./device_wvd_file.wvd"
    
    LICENSE_HEADERS = {
        "AuthorizationToken": "AuthToken1pVHbbtQwFPya5i0r3y8PeYjawlaooIqtFvHmy3ETNom3sdNt-Hrc0oKEACEhWcdH4zlzRp528T1MDpou52M6o-0ZeVPODMPaT3dHM-d1c5yjN5vJmk1-oG6Ii9-4OBZWdZXSAvMvsymnv4w8cX9SXQejSZvHcUjRHDdxvivoKZVCEOLlei69hyn3eS2tG0w_Pr1PZoRmSTUDF6jWrEZMuJoxaWuDJapxUMIG4wGsrXYwmSlf-cZDMMuQqwt46B0U4MuBP3R46uqoeKjpsuD6PmRdd8OIU75Hh0PUL-zdeoTmKqadsQPkqh2GeAL_Kp1-aN8mmIvyv3prnYvLszkqmfRSKw9YEotBBASYhGCRCRIZZbThgBSihlgGwRIbUDCAJBYyMB6Kz2cHLwb-W-63UY29m2OKIb8E-hqWegpL_CGsOQ7QpMUmN_cW5qpdchfn_qvJfZyuTTo0mGvMKKNccIxpMcyZ0pIQijVDQisihFKUYMa1UIRzzDERmiukleCIYEI1oQxhWnouCSOKY1EaVV0-HvsZ0oepKV-vleYa4ep8BpPBfwclwZIX8B2sb5feN04TyRlhNXDpaxY8r8tuqB1QL5VD3HFcba_b84_blnDRnJZPLsB2Pf-8bjF53-9vdx3f7_ubez5fKH2JT3Yr9C29oZdn1H8D",
        "AzukiIMC": "IMC7.2.0_AN_D3.0.0_S0",
        "DeviceProfile": "eyJtb2RlbCI6IkRlc2t0b3AiLCJvc1ZlcnNpb24iOiIxMC4xNS43IiwidmVuZG9yTmFtZSI6IkFwcGxlIiwib3NOYW1lIjoiSFRNTDUiLCJ3dkxldmVsIjoiTDMiLCJkZXZpY2VVVUlEIjoiNzdkNzc4MzBhNTU4NDdhN2I3NzY4ZGFkNjNiNTZkNGUifQ=="
    }
    
    pssh = PSSH(PSSH_VALUE)
    device = Device.load(WVD_FILE)
    cdm = Cdm.from_device(device)
    session_id = cdm.open()
    challenge = cdm.get_license_challenge(session_id, pssh)
    
    licence = requests.post(LICENSE_URL, headers=LICENSE_HEADERS, data=challenge)
    licence.raise_for_status()
    
    cdm.parse_license(session_id, licence.content)
    for key in cdm.get_keys(session_id):
        print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}")
    cdm.close(session_id)
    You gotta get your own CDM (the wvd magic file). I don't recommend downloading the first one you find on the internet since 99.99% of those are already revoked. Using the previous script, I got the mentioned key. If you don't want to bother with your own CDM, then you can use https://cdrm-project.com/
    Then using that key you can download the video. Use the stream detector. Get the index m3u8 link and copy it as a N_m3u8 command.

    Image
    [Attachment 76839 - Click to enlarge]


    Open the CMD or bash or whatever, and paste that command. To that command add the following:
    Code:
    -M format=mkv --key b8ab402803beb8e7bbcdca2b8e68f587:ecc693579cf87b70651843297a52b29e
    And that's it. The video is downloaded and decrypted.

    Image
    [Attachment 76840 - Click to enlarge]


    Originally Posted by [ss]vegeta View Post
    yes, it does
    Oops, didn't notice the comment. Thanks for confirming.
    use this i get this error code“python nbatest.py
    Traceback (most recent call last):
    File "/Users/czm/Downloads/m3u8tools/pywidevine-master/pywidevine/nbatest.py", line 23, in <module>
    licence.raise_for_status()
    File "/Users/czm/Downloads/m3u8tools/pywidevine-master/env/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 469 Client Error: Unknown for url: https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license?ownerUid=azuki&mediaId...e&is_dvr=false
    Quote Quote  
  20. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by jay_670 View Post
    A new code error occurs after running
    It is common sense that when an error occurs for a software you also give the input that you used so I could replicate the issue and fix it. By the way, don't post the full error trace. The input is enough.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  21. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by jay_670 View Post
    A new code error occurs after running
    It is common sense that when an error occurs for a software you also give the input that you used so I could replicate the issue and fix it. By the way, don't post the full error trace. The input is enough.
    I just modified the wvd path to try to run the code you gave me. Do I need to type anything else?
    Quote Quote  
  22. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by jay_670 View Post
    I just modified the wvd path to try to run the code you gave me. Do I need to type anything else?
    I wanna check something just to be safe. Make a free account and log into into it using Firefox. Make sure the browser doesn't delete the cookies. And then run again the script.

    Edit: also show me how you run the script.*
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 12th Mar 2024 at 01:03.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  23. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by jay_670 View Post
    I just modified the wvd path to try to run the code you gave me. Do I need to type anything else?
    I wanna check something just to be safe. Make a free account and log into into it using Firefox. Make sure the browser doesn't delete the cookies. And then run again the script.

    Edit: also show me how you run the script. I have no idea why the nba script is in freevine.
    Thank you, I'm running this way and I think maybe there's something wrong on my side that's causing it to fail.
    (env) czm@czmdeMac-Studio pywidevine % python3 nbadl.py
    Quote Quote  
  24. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by jay_670 View Post
    Thank you, I'm running this way and I think maybe there's something wrong on my side that's causing it to fail.
    Sent you a PM. Debugging remotely it's gonna suck if I can't replicate the issue.

    Edit: I tried simulating running the script as if from another machine and I get a "similar" error as you got (I don't know what's your exact error though). Now if what you get is something along the lines of:
    'message': 'out of country blocked because client is neither in home country nor in content portability region'
    Then stop using a VPN.
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 12th Mar 2024 at 02:56.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  25. KeyError: 'cdns' this error caused by ip address, i used US vpn, the script worked well.

    only one small confuse is that when i run the script, it said line 24 ')' not matched.

    Code:
    v_m3u8 = f"{base_uri}/{manifest_uri.replace("index.m3u8", v_m3u8)}"

    so i must change "index.m3u8" to 'index.m3u8'
    Quote Quote  
  26. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by shellcmd View Post
    KeyError: 'cdns' this error caused by ip address, i used US vpn, the script worked well.

    only one small confuse is that when i run the script, it said line 24 ')' not matched.

    Code:
    v_m3u8 = f"{base_uri}/{manifest_uri.replace("index.m3u8", v_m3u8)}"

    so i must change "index.m3u8" to 'index.m3u8'
    i had use the vpn,but it still does‘t work
    HTTPError: 403 Client Error: Forbidden for url: https://ottapp-appgw-amp.nba.com/v1/client/get-widevine-license?ownerUid=azuki&mediaId...3&is_dvr=false the error code still continue may be i need change vpn
    Quote Quote  
  27. give windscribe a try, need register a free account, and 10GB band/month, totally enough for make video test. or urbanvpn.
    Quote Quote  
  28. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by shellcmd View Post
    give windscribe a try, need register a free account, and 10GB band/month, totally enough for make video test. or urbanvpn.
    I seem to have found that the problem is that my proxy software does not support cmd command Windows and I may still use a regular vpn to get the US ip
    Quote Quote  
  29. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by white_snake View Post
    Well done once again.


    Originally Posted by shellcmd View Post
    so i must change "index.m3u8" to 'index.m3u8'
    I edited the script to fix that. Weird that I can run it, regardless of ' or " (maybe it depends on the python version)
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  30. Member
    Join Date
    Mar 2024
    Location
    bejing
    Search Comp PM
    Originally Posted by jay_670 View Post
    Originally Posted by shellcmd View Post
    give windscribe a try, need register a free account, and 10GB band/month, totally enough for make video test. or urbanvpn.
    I seem to have found that the problem is that my proxy software does not support cmd command Windows and I may still use a regular vpn to get the US ip
    I think I have found the problem Is caused by network problems to 403 because I try to use the curl https://www.nba.com/watch/video/2016-dunk-contest-lavine-vs-gordon-best-ever No response site at all Maybe I need a vps
    Quote Quote  



Similar Threads

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