VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Hello,

    I try to download this video :
    https://www.rmcbfmplay.com/video/rmc-story/faites-entrer-laccuse/s24e12-laurent-dejean...verse=PROVIDER
    But i can't decrypt it..

    I downloaded the manifest.mpd https://tmp3-cdn-edge-live08.pfd.sfr.net/ncdn-cu-kairos-cbv0.pfd.sfr.net/sid=06hiqb76p...9/manifest.mpd

    extracted the pssh :
    Code:
    AAAAZ3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEcSEKqL5HpT5imw4FM7KEUKHLsaA3NmciIkYWE4YmU0N2EtNTNlNi0yOWIwLWUwNTMtM2IyODQ1MGExY2JiKgJTREjj3JWbBg==
    the licence url is :
    Code:
    https://ws-backendtv.rmcbfmplay.com/asgard-drm-widevine/public/licence
    and the header is :
    Code:
    content-length: 5119
    sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Brave";v="122"
    accept: application/json, text/plain, */*
    customdata: description=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36&deviceId=byPassARTHIUS&deviceName=Brave-122.0.0.0-Macintosh--Apple-Mac OS&deviceType=PC&screenType=PC&osName=Mac OS&osVersion=10.15.7&persistent=false&resolution=1454x783&tokenType=castoken&tokenSSO=BFM_P9dPYw4MssWTYKNOtWY5SgXN+IO6OPbO+zmSI7Q/belzaPlEJ8rhGsVKiTlWVxg8hzn7pUiDE04pkRzict9NzZkfOSnV2zS5aH99/tpkPsj3Rhvu6YHA7RSZk+q88OgWW6SwB16DHYHvtcDARAnhlq8iyqL3ZzVhkvUmIWXaJc784owZ/Gs5v3fYXQ2Y26apu&type=REPLAY
    sec-ch-ua-mobile: ?0
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
    sec-ch-ua-platform: "macOS"
    sec-gpc: 1
    accept-language: fr-FR,fr;q=0.7
    origin: https://www.rmcbfmplay.com
    sec-fetch-site: same-site
    sec-fetch-mode: cors
    sec-fetch-dest: empty
    referer: https://www.rmcbfmplay.com/
    accept-encoding: gzip, deflate, br
    Im using cdrm-project's website but im getting :
    Code:
    ERROR
    Error 520:
    Any help is appreciated !
    Quote Quote  
  2. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Cdrm project needs a proxy most likely. I tried playing the video on my browser and their license request returns 520 status code.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  3. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    So IP blocking ? I'll try to run a proxy thank for the answer !
    Quote Quote  
  4. try this one
    Code:
    --key aa8be47a53e629b0e0533b28450a1cbb:a8f3e30c8fc28072e8545cda37a997d7
    Quote Quote  
  5. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Thank IceM it works ! Could I ask how you managed to get the key ? With your own CDM ?
    Quote Quote  
  6. easiest option use StreamFab check PM
    Quote Quote  
  7. Originally Posted by aqzs View Post
    Thank IceM it works ! Could I ask how you managed to get the key ? With your own CDM ?
    With my own CDM, but you can use a proxy in cdrm-project

    Image
    [Attachment 77785 - Click to enlarge]
    Quote Quote  
  8. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Originally Posted by IceM View Post
    Originally Posted by aqzs View Post
    Thank IceM it works ! Could I ask how you managed to get the key ? With your own CDM ?
    With my own CDM, but you can use a proxy in cdrm-project
    Thank you ! I had to try a lot of proxy to get it working but it finally work !
    Quote Quote  
  9. Originally Posted by aqzs View Post
    Thank you ! I had to try a lot of proxy to get it working but it finally work !
    you're welcome
    Quote Quote  
  10. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Here is the downloader for https://www.rmcbfmplay.com . It works only on free videos and only if you have an account.

    Code:
    import base64
    import json
    import re
    from urllib.parse import urlparse, parse_qs
    
    import requests
    from bs4 import BeautifulSoup
    from pywidevine.cdm import Cdm
    from pywidevine.device import Device
    from pywidevine.pssh import PSSH
    
    YOUR_EMAIL = 'YOUR_EMAIL'
    YOUR_PASSWORD = 'YOUR_PASSWORD'
    
    CONFIG_URL = 'https://www.rmcbfmplay.com/assets/configs/config.json'
    CONFIG_CONTENT = json.loads(requests.get(CONFIG_URL).content.decode())
    LICENSE_URL = CONFIG_CONTENT["player"]["shaka"]["drm"]["servers"]["com.widevine.alpha"]
    APP = CONFIG_CONTENT["application"]["app"]
    
    API_OPTIONS = 'https://ws-backendtv.rmcbfmplay.com/gaia-core/rest/api/web/v3/content/{content_id}/options'
    CAS_AUTH = 'https://sso.rmcbfmplay.com/cas/oidc/authorize'
    
    RES_PRIORITY = {"sd": 0, "hd": 1}
    WVD_FILE = "./device_wvd_file.wvd"
    
    
    def get_token():
        with requests.session() as login_session:
            response = login_session.get(
                CAS_AUTH, allow_redirects=False, params={
                    'client_id': CONFIG_CONTENT["auth"]["OIDC_CLIENT_ID"],
                    'scope': 'openid', 'response_type': 'token',
                    'redirect_uri': 'https://www.rmcbfmplay.com'
                }
            )
            redirect = response.headers["location"]
            response = login_session.get(redirect)
    
            soup_login = BeautifulSoup(response.content, 'html5lib')
            form_data = {}
            for element in soup_login.find('form').find_all('input'):
                if element.has_attr('value'):
                    form_data[element['name']] = element['value']
    
            form_data['username'] = YOUR_EMAIL
            form_data['password'] = YOUR_PASSWORD
            form_data['remember-me'] = 'on'
    
            response = login_session.post(redirect, allow_redirects=False, data=form_data)
            redirect = response.headers["location"]
            response = login_session.get(redirect, allow_redirects=False)
            redirect = response.headers["location"]
    
            token = parse_qs(urlparse(redirect).query)["access_token"][0]
            for b64 in token.split("."):
                try:
                    return json.loads(base64.b64decode(b64 + "==").decode())["tu"]
                except:
                    pass
        return None
    
    
    BFM_TOKEN = get_token()
    
    
    def get_video_data(source_url):
        query_params = parse_qs(urlparse(source_url).query)
        content_id = query_params["contentId"][0]
        universe = query_params["universe"][0]
    
        response = json.loads(requests.get(
            API_OPTIONS.format(content_id=content_id),
            params={
                'app': APP, 'device': 'browser',
                'token': BFM_TOKEN, 'universe': universe
            }
        ).content.decode())
    
        manifest = []
        for product in response:
            if product["productId"] != content_id:
                continue
            for offer in product["offers"]:
                for stream in offer["streams"]:
                    if stream["drm"] != "WIDEVINE":
                        continue
                    manifest += [(offer["definition"].lower(), stream["url"])]
        manifest = sorted(manifest, key=lambda m: RES_PRIORITY[m[0]], reverse=True)[0][1]
    
        try:
            pssh_value = str(min(re.findall(
                r'<cenc:pssh>(.+?)</cenc:pssh>',
                requests.get(manifest).content.decode()
            ), key=len))
        except:
            return manifest, None
        return manifest, pssh_value
    
    
    def get_keys(pssh_value):
        if pssh_value 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={
                'customdata': f'description=description&deviceName=deviceName&deviceType=PC&tokenType=castoken&tokenSSO={BFM_TOKEN}'
            }
        )
        if licence.status_code == 520:
            print("VPN Failure")
        licence.raise_for_status()
    
        keys = []
        cdm.parse_license(cdm_session_id, licence.content)
        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 = get_video_data(source_url)
        keys = get_keys(pssh_value)
    
        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 = [
        "https://www.rmcbfmplay.com/video/rmc-story/faites-entrer-laccuse/s24e12-laurent-dejean-et-la-joggeuse-de-bouloc?contentId=Product::NEUF_NUM23_N23955010611527&universe=PROVIDER",
        "https://www.rmcbfmplay.com/video/rmc-story/retour-a-linstinct-primaire/s4e12-lile-aux-larmes?contentId=Product::NEUF_NUM23_N23934394141527&universe=PROVIDER",
        "https://www.rmcbfmplay.com/video/rmc-decouverte/top-gear-france-avec-vilebrequin/s9e1-ceux-qui-partent-en-allemagne?contentId=Product::NEUF_RMCDEC_RMC00202288&universe=PROVIDER",
        "https://www.rmcbfmplay.com/video/rmc-story/le-pal-au-coeur-du-zoo-le-plus-insolite-de-france?contentId=Product::NEUF_NUM23_N23544692327527&universe=PROVIDER",
        "https://www.rmcbfmplay.com/video/rmc-story/mennonites-enquete-sur-la-communaute-la-plus-fermee-du-monde?contentId=Product::NEUF_NUM23_N23949474199527&universe=PROVIDER",
    ]
    for s in SOURCE_URLS:
        print(get_download_command(s))
    Output:
    Code:
    N_m3u8DL-RE.exe "https://ncdn-cu-kairos-cbv0.pfd.sfr.net/dashcenc/catchup/NEUF_NUM23/235/N23_e4020977f8_5e39930b72a44de59/manifest.mpd" --key aa8be47a53e629b0e0533b28450a1cbb:a8f3e30c8fc28072e8545cda37a997d7 -M format=mkv
    N_m3u8DL-RE.exe "https://ncdn-cu-kairos.pfd.sfr.net/dashcenc/catchup/NEUF_NUM23/ead/N23_06881f9798_fe2e66a3bcd447939/manifest.mpd" --key aa8be47a53e629b0e0533b28450a1cbb:a8f3e30c8fc28072e8545cda37a997d7 -M format=mkv
    N_m3u8DL-RE.exe "https://ncdn-cu-kairos.pfd.sfr.net/dashcenc/catchup/NEUF_RMCDEC/d82/RMC_eb3b132373_ef025978cfdb4ce08/manifest.mpd" --key aa8be47a53db29b0e0533b28450a1cbb:1a1027b7e1c097a80e4bd4522c8ea4e4 -M format=mkv
    N_m3u8DL-RE.exe "https://ncdn-cu-kairos.pfd.sfr.net/dashcenc/catchup/NEUF_NUM23/c90/N23_c8297f274a_41f44c22c86f4f0e9/manifest.mpd" --key aa8be47a53e629b0e0533b28450a1cbb:a8f3e30c8fc28072e8545cda37a997d7 -M format=mkv
    N_m3u8DL-RE.exe "https://ncdn-cu-kairos-cbv0.pfd.sfr.net/dashcenc/catchup/NEUF_NUM23/ac0/N23_737c8fb6b9_b087b1371fea4508a/manifest.mpd" --key aa8be47a53e629b0e0533b28450a1cbb:a8f3e30c8fc28072e8545cda37a997d7 -M format=mkv
    You need a French IP just to run the script. If the script returns "VPN Failure" then choose a new IP. After obtaining the download commands, you can turn the VPN off to avoid wasting data on the actual N_m3u8 download.

    Their website uses CAS (Central Authentication Service) for login and I haven't found an easy way to automate the login mechanism using a simple name/password. If anyone knows or can give a hint, feel free to share. To bypass it, the script uses local Firefox cookies. If the script returns "No cookie found", then log out of your account in your current Firefox session, log back to refresh the cookies, wait 5-10 seconds, and start the script again (don't close the browser).

    Edit: Also it seems that the same key was used for 4 separate videos on their site. That's a new one.

    Edit2: If you get other unrelated issues, make sure you refresh the needed cookie by logging out and back.

    Edit3: Seems automating the CAS login mechanism wasn't that hard. The script now only needs a mail/password. No external cookies are anymore needed.

    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:27.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  11. Member
    Join Date
    Mar 2024
    Location
    France
    Search PM
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Here is the downloader for https://www.rmcbfmplay.com . It works only on free videos and only if you have an account.

    [...]
    Hello,
    How to use your script please?

    I try too to download videos from RMC BFM Play.
    Thanks
    Quote Quote  
  12. Member aqzs's Avatar
    Join Date
    Mar 2024
    Location
    Paris
    Search Comp PM
    Originally Posted by Morph95 View Post
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Here is the downloader for https://www.rmcbfmplay.com . It works only on free videos and only if you have an account.

    [...]
    Hello,
    How to use your script please?

    I try too to download videos from RMC BFM Play.
    Thanks
    I managed to get things working, I can help you if you want ? Do you know about L3 ? I send you a pm
    Quote Quote  



Similar Threads

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