VideoHelp Forum
+ Reply to Thread
Results 1 to 1 of 1
Thread
  1. https://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=C1KrqCWRhfmaitSetissSla...gentRule=mpd-*
    (note the parameters output=64 and overrideUserAgentRule)

    With this url we obtain a xml with mpd and auth, replacing * with 5000 the error almost seems a suggestion:
    Relinker Exception: Needed one of those content type (and bitrate if not *): mpd-5000

    https://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=C1KrqCWRhfmaitSetissSla...5000&output=64
    (note the new parameter forceUserAgent=mpd-5000, output=64 as before)

    This parameter looks promising...

    I made a shell script to make the creation of the headers.py file faster:

    Code:
    #|/bin/bash
    read -p "pssh: " pssh
    read -p "lic: " lic
    read -p "auth: " auth
    cat > ~/.local/cdm/headers.py << EOF
    import requests
    
    headers = {
        'nv-authorizations': '$auth',
    }
    EOF
    l3.py $pssh $lic
    replace ~/.local/cdm/headers.py to the path where your header.py is located
    l3.py is slightly modified to accept pssh and lic (license link) as parameters:

    Code:
    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    # Module: KEYS-L3
    # Created on: 11-10-2021
    # Authors: -∞WKS∞-
    # Version: 1.1.0
    import base64, requests, sys, xmltodict
    import headers
    from pywidevine.L3.cdm import cdm, deviceconfig
    from base64 import b64encode
    from pywidevine.L3.getPSSH import get_pssh
    from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt
    
    def main():
        # Verifica che siano forniti due argomenti
        if len(sys.argv) != 3:
            print("Sintassi: l3.py <pssh> <lic_url>")
            return
        # Leggi gli argomenti dalla riga di comando
        pssh = sys.argv[1]
        lic_url = sys.argv[2]
        correct, keys = WV_Function(pssh, lic_url)
        for key in keys:
            print('--key ' + key)
    
    def WV_Function(pssh, lic_url, cert_b64=None):
        wvdecrypt = WvDecrypt(init_data_b64=pssh, cert_data_b64=cert_b64, device=deviceconfig.device_android_generic)
        widevine_license = requests.post(url=lic_url, data=wvdecrypt.get_challenge(), headers=headers.headers)
        license_b64 = b64encode(widevine_license.content)
        wvdecrypt.update_license(license_b64)
        Correct, keyswvdecrypt = wvdecrypt.start_process()
        if Correct:
            return Correct, keyswvdecrypt
    
    if __name__ == "__main__":
        main()
    Code:
    yt-dlp --allow-unplayable-formats "https://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=C1KrqCWRhfmaitSetissSlashRGgeeqqEEqualeeqqEEqual&forceUserAgent=mpd-5000&output=64"
    Now:
    Code:
    mp4decrypt --key 32dfa84df6cd34299cfcb442e79e856e:c4a73b7fe7d15b5dcea1d94f6b2c80db obfuscate.mp4 clear.mp4
    Finally a decrypted video with a resolution of 1920x1080, same for audio (to do: remove the boring audio description)

    Edit:
    I found a way to download only the audio part in italian:
    Code:
    yt-dlp --allow-unplayable-formats -f "ba[language=Italiano]" "https://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=C1KrqCWRhfmaitSetissSlashRGgeeqqEEqualeeqqEEqual&forceUserAgent=mpd-5000"
    Last edited by lucacolaiacomo; 4th Sep 2024 at 03:21. Reason: Added quotes so that yt-dlp interprets the link correctly, a way to download only italian track
    Quote Quote  



Similar Threads

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