VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. So I'm trying to download https://www.vrt.be/vrtmax/a-z/de-jaren-00-voor-tieners/1/de-jaren-00-voor-tieners-s1a1/ (and the other seasons+episodes)
    Looking at the mpd https://vod.vrtcdn.be/remix/content/vod/pl-142d5ce8-b371-4478-8232-cd2957e028aa/pl-142...!%3D%22AACL%22)) I cannot seem to locate the PSSH needed for http://108.181.133.95:8080/

    Any idea what I am doing wrong ?
    Quote Quote  
  2. Member
    Join Date
    May 2025
    Location
    Out their somewhere in the land of Kangaroos and Koalas.
    Search PM
    Found with VRT you need to extract the PSSH from the initialisation segment of the video as it's not in the MPD.

    For this particular content the PSSH is:

    Code:
    AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8iN3ZpZC1kYjM2YWJiYy05YTg3LTRhZjItYmFlOS04MDFmMDQxZTgyYjgtQ0ROXzVfSEQyMDI0TUZI49yVmwY=
    Quote Quote  
  3. may I ask how you found the init file ? only finding the commercial mp4's.
    I think I know how to extract the PSSH from the init file, but if I know how to find that one, then I'm off to the races for all the episodes

    And thx for the first PSSH already !
    Quote Quote  
  4. if you only need the init.mp4, you can use yt-dlp.


    Code:
    yt-dlp --quiet --no-warnings --allow-u --test -f bestvideo -o "./temp/video_segment_init.mp4" mpd_url
    Quote Quote  
  5. Member
    Join Date
    May 2025
    Location
    Out their somewhere in the land of Kangaroos and Koalas.
    Search PM
    Originally Posted by dwayne13 View Post
    may I ask how you found the init file ? only finding the commercial mp4's.
    I think I know how to extract the PSSH from the init file, but if I know how to find that one, then I'm off to the races for all the episodes

    And thx for the first PSSH already !

    Used some Python code that has been posted on here by various users and modified for VRT.

    Code:
    import base64
    import requests
    import json
    import xmltodict
    
    def find_wv_pssh_offsets(raw: bytes) -> list:
        offsets = []
        offset = 0
        while True:
            offset = raw.find(b'pssh', offset)
            if offset == -1:
                break
            size = int.from_bytes(raw[offset-4:offset], byteorder='big')
            pssh_offset = offset - 4
            offsets.append(raw[pssh_offset:pssh_offset+size])
            offset += size
        return offsets
    
    def to_pssh(content: bytes) -> list:
        wv_offsets = find_wv_pssh_offsets(content)
        return [base64.b64encode(wv_offset).decode() for wv_offset in wv_offsets]
    
    def from_file(init_location: str) -> list:
        print(f'Extracting PSSHs from init location: {init_location}\n')
        init_request = requests.get(init_location).content
        return to_pssh(init_request)
    
    
    def extract_init(manifest: str):
        parse_mpd = xmltodict.parse(manifest)
        MPD_JSON = json.loads(json.dumps(parse_mpd))
        a = MPD_JSON['MPD']['BaseURL']
        b = MPD_JSON['MPD']['Period']['BaseURL']
        c = MPD_JSON['MPD']['Period']['AdaptationSet'][0]['SegmentTemplate']['@initialization']
        int_location = f'{a}{b}{c}'
        represent = MPD_JSON['MPD']['Period']['AdaptationSet'][0]['Representation']['@id']
        int_location = int_location.replace('$RepresentationID$',represent)
        return int_location
    
    
    
    mpd_url = 'https://vod.vrtcdn.be/ondemand/content/vod/vid-db36abbc-9a87-4af2-bae9-801f041e82b8-CDN_5_HD2024MF/vid-db36abbc-9a87-4af2-bae9-801f041e82b8-CDN_5_HD2024MF_drm_da4d7ea1-0489-464e-aa06-a8afe6d1aa69.ism/.mpd?filter=%28%21%28type%3D%3D%22audio%22%26%26FourCC%21%3D%22AACL%22%29%29'
    manifest = requests.get(mpd_url).text
    
    init_location = extract_init(manifest)
    psshList = from_file(init_location)
    
    for x,y in enumerate(psshList):
        print(f'Extracted PSSH {x+1}: {y}\n')
    Quote Quote  
  6. Thx for the script, works like a charm.
    http://108.181.133.95:8080/ is throwing an Error 403 now.

    PSSH: AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8iN3ZpZC 1kYjM2YWJiYy05YTg3LTRhZjItYmFlOS04MDFmMDQxZTgyYjgt Q0ROXzVfSEQyMDI0TUZI49yVmwY=
    License: https://widevine-proxy.drm.technology/proxy
    Headers:
    Firefox/136.0
    Accept: "*/*"
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate, br, zstd
    Referer: https://www.vrt.be/
    Content-Type: text/plain;charset=UTF-8
    Content-Length: "250"
    Origin: https://www.vrt.be
    Connection: keep-alive
    Sec-Fetch-Dest: empty
    Sec-Fetch-Mode: cors
    Sec-Fetch-Site: cross-site
    Priority: u=4

    First time I encounter that 403 error, no clue what the cause could be ?
    Quote Quote  
  7. Member
    Join Date
    May 2025
    Location
    Out their somewhere in the land of Kangaroos and Koalas.
    Search PM
    Originally Posted by dwayne13 View Post
    Thx for the script, works like a charm.
    http://108.181.133.95:8080/ is throwing an Error 403 now.

    PSSH: AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8iN3ZpZC 1kYjM2YWJiYy05YTg3LTRhZjItYmFlOS04MDFmMDQxZTgyYjgt Q0ROXzVfSEQyMDI0TUZI49yVmwY=
    License: https://widevine-proxy.drm.technology/proxy
    Headers:
    Firefox/136.0
    Accept: "*/*"
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate, br, zstd
    Referer: https://www.vrt.be/
    Content-Type: text/plain;charset=UTF-8
    Content-Length: "250"
    Origin: https://www.vrt.be
    Connection: keep-alive
    Sec-Fetch-Dest: empty
    Sec-Fetch-Mode: cors
    Sec-Fetch-Site: cross-site
    Priority: u=4

    First time I encounter that 403 error, no clue what the cause could be ?
    Don't think you will have much luck with that site for VRT due to how the requests are handled as the request is sent to the licence server as a JSON payload and will contain a token as well as the licence challenge. You will need to use a browser add on like WidevineProxy2 or alternatively write a script using WKS-Keys or something similar.
    Quote Quote  
  8. used WidevindProxy2 plugin and that worked like a charm !
    Thank you very much for the help, much appreciated !
    Quote Quote  



Similar Threads

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