VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  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  
  2. For all friends who want to download the previous formats used by RaiPlay (such as Space: 1999), I personally used the excellent script from andrealazzarotto.com, which I highly recommend checking out. If it's unavailable, you can simply use `yt-dlp`:

    Code:
    yt-dlp "https://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=4jkHHupPpPlusserLWePCRj0crvKgeeqqEEqualeeqqEEqual&forceUserAgent=*-5000" --fixup never -o "Space 1999 - E1.mp4"
    Remember that to get HD formats, you need to add &forceUserAgent=*-5000 at the end of the *mediapolis* link. You can find this link by replacing `html` with `json` in the URL of the chosen episode.
    Quote Quote  
  3. Member G.T.X.R's Avatar
    Join Date
    Jan 2025
    Location
    Europe
    Search Comp PM
    Or use this method, it's faster.

    Than crop to 1440p x 1080p :

    Code:
    @echo off& cd /D "%~dp0"& chcp 1252& cls
    
    for %%a in (.\*.mp4) do ( ffmpeg -i ".\%%a" -acodec copy -filter:v "crop=1440:1080" "%%~na(1440x1080)%%~xa" )
    
    exit
    Quote Quote  



Similar Threads

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