VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 45
Thread
  1. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Is it possible to download such a file?
    DRM + fragmentation

    https://www.cda.pl/video/1670449e2/vfilm
    Quote Quote  
  2. Originally Posted by rgr View Post
    Is it possible to download such a file?
    DRM + fragmentation

    https://www.cda.pl/video/1670449e2/vfilm
    Need login.
    Quote Quote  
  3. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    It is not needed, can watch without logging in.
    Quote Quote  
  4. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by rgr View Post
    Is it possible to download such a file?
    DRM + fragmentation

    https://www.cda.pl/video/1670449e2/vfilm
    Code:
    N_m3u8DL-RE.exe https://vcze131.cda.pl/1670449/1670449.mpd --key 65353534306438366535346135346161:39303439626631336363393537303934 -M format=mkv
    Here's your movie (apparently it's just the first part of 4): https://www.transfernow.net/dl/20240226Acbs3b9g

    Originally Posted by white_snake View Post
    Need login.
    Polish proxy
    Quote Quote  
  5. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Wow, impressive! I didn't think it was possible
    It's downloading.
    Is the key the same for the entire cda.pl or will it be different for each file? How to get it?

    Edit: But it's not that simple. Only the first seconds are good :/
    Quote Quote  
  6. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by rgr View Post
    Wow, impressive! I didn't think it was possible
    It's downloading.
    Is the key the same for the entire cda.pl or will it be different for each file? How to get it?

    Edit: But it's not that simple. Only the first seconds are good :/
    The key is unique. I don't think it's even mathematically possible for 2 videos to have the same keys. If you ever find 2 such videos, you might as well go to a lottery. You can get the keys by spending some time learning about widevine. Read all the sticky threads.

    Edit: Here are the other 3 parts of your movie
    Code:
    N_m3u8DL-RE.exe https://vcze133.cda.pl/1670500/1670500.mpd --key 61373732666330633837613961376537:62306233663637633063306231316336 -M format=mkv
    N_m3u8DL-RE.exe https://vcze133.cda.pl/1670542/1670542.mpd --key 65353434363733646435376239313533:31663865646663333839373536613733 -M format=mkv
    N_m3u8DL-RE.exe https://vcze133.cda.pl/1670572/1670572.mpd --key 65393535653839613762613264653965:61313762326463356164353236313733 -M format=mkv
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 26th Feb 2024 at 09:25.
    Quote Quote  
  7. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by white_snake View Post
    Need login.
    Polish proxy
    Yup, I figured. It said you needed to be a premium user without Polish proxy, so I didn't even try, lol

    Originally Posted by rgr View Post
    Wow, impressive! I didn't think it was possible
    It's downloading.
    Is the key the same for the entire cda.pl or will it be different for each file? How to get it?

    Edit: But it's not that simple. Only the first seconds are good :/
    It will be different for each video. What do you mean "only the first seconds are good"? Video downloads just fine, I can play the whole 1+ hours of it.
    Quote Quote  
  8. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    I'm downloading something like this.
    (Somehow I managed to download the same thing using Developer Tools some time ago)
    https://files.fm/u/t3ategytkq

    16:27:14.352 INFO : N_m3u8DL-RE (Beta version) 20230628
    16:27:14.369 INFO : Loading URL: https://vcze131.cda.pl/1670449/1670449.mpd
    16:27:14.555 INFO : Content Matched: Dynamic Adaptive Streaming over HTTP
    16:27:14.556 INFO : Parsing streams...
    16:27:14.560 WARN : Writing meta json
    16:27:14.561 INFO : Extracted, there are 5 streams, with 3 basic streams, 2 audio streams, 0 subtitle streams
    16:27:14.562 INFO : Vid *CENC 1280x722 | 2515 Kbps | 3 | 25 | avc1.42c01f | 1 Segment | ~01h14m40s
    16:27:14.562 INFO : Vid *CENC 854x482 | 1410 Kbps | 1 | 25 | avc1.42c01e | 1 Segment | ~01h14m40s
    16:27:14.563 INFO : Vid *CENC 640x362 | 708 Kbps | 0 | 25 | avc1.42c015 | 1 Segment | ~01h14m40s
    16:27:14.564 INFO : Aud *CENC 4 | 164 Kbps | mp4a.40.2 | 2CH | 1 Segment | ~01h14m40s
    16:27:14.565 INFO : Aud *CENC 2 | 132 Kbps | mp4a.40.2 | 2CH | 1 Segment | ~01h14m40s
    16:27:22.031 INFO : Parsing streams...
    16:27:22.032 INFO : Selected streams:
    16:27:22.033 INFO : Vid *CENC 1280x722 | 2515 Kbps | 3 | 25 | avc1.42c01f | 1 Segment | ~01h14m40s
    16:27:22.033 INFO : Aud *CENC 4 | 164 Kbps | mp4a.40.2 | 2CH | 1 Segment | ~01h14m40s
    16:27:22.034 WARN : Writing meta json
    16:27:22.038 INFO : Save Name: 1670449_2024-02-26_16-27-14
    16:27:22.038 WARN : MuxAfterDone is detected, binary merging is automatically enabled
    16:27:22.158 INFO : Start downloading...Vid 1280x722 | 2515 Kbps | 3 | 25 | avc1.42c01f
    16:27:23.910 WARN : Type: cenc
    16:27:23.937 WARN : PSSH(WV): EhBlNTU0MGQ4NmU1NGE1NGFhSOPclZsG
    16:27:23.965 WARN : KID: 65353534306438366535346135346161
    16:27:23.979 WARN : Reading media info...
    16:27:24.073 INFO : [0x1]: Video, h264 (Constrained Baseline) (avc1), 1280x722, 25 fps, 19 kb/s
    16:27:58.204 INFO : Binary merging...
    16:27:59.818 INFO : Decrypting...
    16:28:00.020 INFO : Start downloading...Aud 4 | 164 Kbps | mp4a.40.2 | 2CH
    16:28:02.345 WARN : Type: cenc
    16:28:02.354 WARN : PSSH(WV): EhBlNTU0MGQ4NmU1NGE1NGFhSOPclZsG
    16:28:02.373 WARN : KID: 65353534306438366535346135346161
    16:28:02.376 WARN : Reading media info...
    16:28:02.514 INFO : [0x1]: Audio, aac (LC) (mp4a), 18 kb/s
    16:28:05.536 INFO : Binary merging...
    16:28:05.695 INFO : Decrypting...
    16:28:05.753 WARN : 1670449_2024-02-26_16-27-14.mp4
    16:28:05.754 WARN : 1670449_2024-02-26_16-27-14.m4a
    16:28:05.754 WARN : Muxing to 1670449_2024-02-26_16-27-14.MUX.mkv
    16:28:09.761 WARN : Cleaning files...
    16:28:09.864 WARN : Rename to 1670449_2024-02-26_16-27-14.mkv
    16:28:09.865 INFO : Done
    Quote Quote  
  9. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    ...So are the videos downloading OK?

    Originally Posted by rgr View Post
    (Somehow I managed to download the same thing using Developer Tools some time ago)
    They probably didn't have DRM before or they used something else. Depends on what you understand by "some time ago".

    PS: I added the other 3 parts in case you're interested seeing as this one was only 1/4.
    Quote Quote  
  10. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    No, every one I downloaded is bad. They are all like the one I uploaded on files.fm. And yours is OK :/
    Some time ago = few days.
    Quote Quote  
  11. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by rgr View Post
    No, every one I downloaded is bad. They are all like the one I uploaded on files.fm. And yours is OK :/
    Some time ago = few days.
    Out of curiosity try this one
    Code:
    N_m3u8DL-RE.exe https://vcze131.cda.pl/1670449/1670449.mpd?uid=5983825771 --key 65353534306438366535346135346161:39303439626631336363393537303934 -M format=mkv
    Quote Quote  
  12. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    No success :/

    I downloaded mp4decrypt from https://www.bento4.com/documentation/mp4decrypt/

    I removed the --key section from the line and got another file, but with the same length and it plays just as badly.
    Your (good) one is 13 bytes longer.
    Quote Quote  
  13. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Try decrypting them manually. Get the latest N_m3u8 and the latest mp4decrypt. Use N_m3u8 for download and decrypt using mp4decrypt. Of course the downloaded file can't be played after you removed --key because it is encrypted. Your problem makes no sense though. :/

    Edit: Wait, you said you downloaded mp4decrypt, so you didn't have it before? Well of course it didn't worked. Put mp4decrypt.exe in the same directory as N_m3u8 exe
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 26th Feb 2024 at 10:44.
    Quote Quote  
  14. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    No, I had it, N_m3u8 exe wouldn't run without it. I just wrote where I got this file from.
    Or maybe this key is variable (over time or depending on the IP address), is this possible?
    Quote Quote  
  15. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by rgr View Post
    No, I had it, N_m3u8 exe wouldn't run without it. I just wrote where I got this file from.
    Or maybe this key is variable (over time or depending on the IP address), is this possible?
    Then I don't know. @white_snake said it worked for him. The keys aren't variable, they are fixed. It is not feasible at all to store different encrypted videos with the same quality when it comes to storage. So I guess the problem is on your end. Maybe someone else can figure it out. Try decrypting them manually with mp4decrypt with the key I gave you after downloading (with the --key removed in N_m3u8 command)
    Quote Quote  
  16. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Manually decrypting worked.

    I found an error, but I don't know if it's in N_m3* or mp4decrypt -- it doesn't work properly and doesn't show any error if it's in a folder with national characters.

    Reported: https://github.com/nilaoda/N_m3u8DL-RE/issues/364
    Last edited by rgr; 26th Feb 2024 at 12:35.
    Quote Quote  
  17. Originally Posted by rgr View Post
    Manually decrypting worked.

    I found an error, but I don't know if it's in N_m3* or mp4decrypt -- it doesn't work properly and doesn't show any error if it's in a folder with national characters.

    Reported: https://github.com/nilaoda/N_m3u8DL-RE/issues/364
    What does "national characters" even mean? I would tell you to --use-shaka-packager instead, but mp4decrypt works just fine with this video. Make sure you have an updated version of N_m3u8DL-RE as well.
    Quote Quote  
  18. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    ąćęłńśżź -- probably with too.
    Quote Quote  
  19. Originally Posted by rgr View Post
    ąćęłńśżź -- probably with too.
    Okay, but the description of your issue is still not clear. What needs to have those characters to reproduce the issue? The current working folder? The folder N_m3u8LD-RE is in? The folder mp4decrypt is in? Or what? If you explain it better, I'll try to reproduce it.

    I also highly doubt N_m3u8DL-RE doesn't have support for the full Unicode map since the author is Chinese.
    Quote Quote  
  20. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by white_snake View Post
    Originally Posted by rgr View Post
    ąćęłńśżź -- probably with too.
    Okay, but the description of your issue is still not clear. What needs to have those characters to reproduce the issue? The current working folder? The folder N_m3u8LD-RE is in? The folder mp4decrypt is in? Or what? If you explain it better, I'll try to reproduce it.

    I also highly doubt N_m3u8DL-RE doesn't have support for the full Unicode map since the author is Chinese.
    From what I noticed - all we need to do is work in a folder with national characters, and the exe files can be in any folder (of course PATH in Windows must be set properly). I suspect there is a path problem when calling mp4decrypt via N_m3u8LD-RE or mp4decrypt doesn't accept path with national chars.
    Known bug, so I found it easily. ffmpeg was fixed 1-2 years ago and ffms2 was fixed recently after my reports. Both had a problem with national characters in filenames.
    Quote Quote  
  21. Originally Posted by rgr View Post
    Originally Posted by white_snake View Post
    Originally Posted by rgr View Post
    ąćęłńśżź -- probably with too.
    Okay, but the description of your issue is still not clear. What needs to have those characters to reproduce the issue? The current working folder? The folder N_m3u8LD-RE is in? The folder mp4decrypt is in? Or what? If you explain it better, I'll try to reproduce it.

    I also highly doubt N_m3u8DL-RE doesn't have support for the full Unicode map since the author is Chinese.
    From what I noticed - all we need to do is work in a folder with national characters, and the exe files can be in any folder (of course PATH in Windows must be set properly). I suspect there is a path problem when calling mp4decrypt via N_m3u8LD-RE or mp4decrypt doesn't accept path with national chars.
    Known bug, so I found it easily. ffmpeg was fixed 1-2 years ago and ffms2 was fixed recently after my reports. Both had a problem with national characters in filenames.
    You're right, I was able to reproduce it: created a folder named ąćęłńśżź and set it as current directory in cmd. Here's the results:
    • When using ffmpeg as muxer (-M format=mkv) it yields a playable file that shows a black screen (i.e. wasn't decrypted).
    • Tried to use mkvmerge (-M muxer=mkvmerge) instead of ffmpeg and it produced an unplayable file.
    • Then tried to use shaka as decrypter (--use-shaka-packager) and it finally generated a good file, so it's safe to say mp4decrypt is the problem here.

    Edit: you should try manually decrypting with mp4decrypt using paths with those characters and see if the problem occurs. If it does, you should rather open an issue here: https://github.com/axiomatic-systems/Bento4/issues

    If it doesn't, then it's probably N_m3u8DL-RE's fault in passing the arguments to ffmpeg/mp4decrypt. Either way you should elaborate more on the issue, it's hardly understandable as it is now.
    Last edited by white_snake; 27th Feb 2024 at 09:56.
    Quote Quote  
  22. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Here is a downloader for https://www.cda.pl . It works only for free DRM content. No account needed. Only Polish IP.

    Code:
    import html
    import json
    import re
    
    import requests
    from cf_clearance import sync_cf_retry, sync_stealth
    from playwright.sync_api import sync_playwright
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    WVD_FILE = "device_wvd_file.wvd"
    
    MAIN_URL = "https://www.cda.pl"
    CF_RETRIES = 8
    
    
    def bypass_cloudflare():
        user_agent, cf_clearance = None, None
        retry = 0
        failure = False
    
        with sync_playwright() as spw:
            browser = spw.firefox.launch(headless=True)
            page = browser.new_page()
    
            sync_stealth(page)
            page.goto(MAIN_URL)
            while True:
                if sync_cf_retry(page):
                    for cookie in page.context.cookies():
                        if cookie.get('name') == 'cf_clearance':
                            cf_clearance = cookie.get('value')
                            break
                    user_agent = page.evaluate('() => {return navigator.userAgent}')
    
                    if cf_clearance is not None:
                        break
                else:
                    retry = CF_RETRIES
    
                retry += 1
                if retry >= CF_RETRIES:
                    failure = True
                    break
            browser.close()
    
        if failure:
            print("Failed to bypass cloudflare")
            exit(0)
        return user_agent, cf_clearance
    
    
    def check_cloudflare():
        if "Just a moment..." in requests.get(MAIN_URL).content.decode():
            user_agent, cf_clearance = bypass_cloudflare()
            return {"User-Agent": user_agent, "cf_clearance": cf_clearance}
        return {"User-Agent": None, "cf_clearance": None}
    
    
    CLOUDFLARE = check_cloudflare()
    
    
    def get_keys(pssh_value, license_url, custom_data):
        if pssh_value is None:
            return []
        try:
            device = Device.load(WVD_FILE)
        except:
            return []
    
        pssh_value = PSSH(pssh_value)
        cdm = Cdm.from_device(device)
        cdm_session_id = cdm.open()
    
        challenge = cdm.get_license_challenge(cdm_session_id, pssh_value)
        licence = requests.post(
            license_url, data=challenge,
            headers={'x-dt-custom-data': custom_data}
        )
        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_video_data(source_url):
        response = requests.get(
            source_url, cookies={'cf_clearance': CLOUDFLARE['cf_clearance']},
            headers={'User-Agent': CLOUDFLARE['User-Agent']}
        ).content.decode()
        if "player_data" not in response:
            print("VPN error")
            exit(0)
    
        content = json.loads(html.unescape(re.findall(
            r'player_data="([^"]*)"',
            response
        )[0]))["video"]
        manifest = content["manifest"]
        license_url = content["manifest_drm_proxy"]
        custom_data = content["manifest_drm_header"]
    
        try:
            pssh_value = str(min(re.findall(
                r'<cenc:pssh\b[^>]*>(.*?)</cenc:pssh>',
                requests.get(manifest).content.decode()
            ), key=len))
        except:
            return manifest, None, None, None
        return manifest, pssh_value, license_url, custom_data
    
    
    def get_download_command(source_url):
        manifest, pssh, license_url, custom_data = get_video_data(source_url)
        if manifest is None:
            return f"No manifest found for {source_url}"
    
        keys = get_keys(pssh, license_url, custom_data)
        if len(keys) == 0:
            if pssh is not None:
                return f"Need local CDM (in WVD format) for {source_url}"
            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 = [
        "https://www.cda.pl/video/1670572f2/vfilm",
        "https://www.cda.pl/video/250188864/vfilm",
        "https://www.cda.pl/video/2508939fb/vfilm",
        "https://www.cda.pl/video/161441361/vfilm",
        "https://www.cda.pl/video/153780264/vfilm",
    ]
    
    for s in SOURCE_URLS:
        print(get_download_command(s))
    Output:
    Code:
    N_m3u8DL-RE.exe "https://vcze133.cda.pl/1670572/1670572.mpd" --key 65393535653839613762613264653965:61313762326463356164353236313733 -M format=mkv
    N_m3u8DL-RE.exe "https://vcze132.cda.pl/2501888/2501888.mpd" --key 61613231316161643435373634633964:66373332396336306463303230643834 -M format=mkv
    N_m3u8DL-RE.exe "https://vcze134.cda.pl/2508939/2508939.mpd" --key 31323139303536666134663734373337:66656633633631623466396665636334 -M format=mkv
    N_m3u8DL-RE.exe "https://vcze804.cda.pl/1614413/1614413.mpd" --key 33646461333363393134353838643932:35623262336231363562663331356237 -M format=mkv
    N_m3u8DL-RE.exe "https://vcze801.cda.pl/1537802/1537802.mpd" --key 33356535653566373663643734313536:30313135616230306632306139643832 -M format=mkv
    The download command can be used without a VPN to avoid wasting data. The site uses Cloudflare protection but that can be bypassed by generating a cf_clearance cookie using an automated browser. The non-DRM content can be easily downloaded by looking at the network requests for a mp4 file.
    Quote Quote  
  23. Well done as always pepe.
    Quote Quote  
  24. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by [ss]vegeta View Post
    Well done as always pepe.
    Thank you Wasn't expecting this specific level of cloudflare protection to be bypassed that easily.
    Quote Quote  
  25. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by [ss]vegeta View Post
    Well done as always pepe.
    Thank you Wasn't expecting this specific level of cloudflare protection to be bypassed that easily.
    Wow, great job.

    But how to use this script?
    Quote Quote  
  26. Originally Posted by rgr View Post
    Wow, great job.

    But how to use this script?
    Save this script in a text file and name it cdapl.py, install python (select option to add it to PATH), open your command prompt, run
    Code:
    python cdapl.py
    Quote Quote  
  27. Hi,
    Please explain what I should do (preferably step by step) if I get the message "Need local CDM (in WVD format) for ...", unfortunately many people have the same problem.
    Quote Quote  
  28. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by PepeForEver View Post
    explain what I should do (preferably step by step) if I get the message "Need local CDM (in WVD format) for ..."
    Read the sticky threads.
    Quote Quote  
  29. @2nHxWW6GkN1l916N3ayz8HQoi I installed pywidevine, so I don't understand where the problem is, what should I do? I'm looking for similar threads on videohelp but I don't see a solution
    Quote Quote  
  30. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by PepeForEver View Post
    I don't understand where the problem is, what should I do
    Are you sure you read them all? The error text is descriptive enough. Did you dump an android cdm? Did you convert it to wvd?
    Quote Quote  



Similar Threads

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