VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. try this

    Code:
    kid  322D10DD-B94C-12A3-E022-FE9C75C8B905
    pssh AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEDItEN25TBKj4CL+nHXIuQU=
    Quote Quote  
  2. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    big thank bro
    bud i want to understand how to if you can give a tip how you do it ?

    kind regarts
    Quote Quote  
  3. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by senkron24 View Post
    bud i want to understand how to if
    Of course you do. Use this https://files.videohelp.com/u/301890/keydump.zip. The content - keydump.py - downloads and examines the first audio fragment for the KID and PSSH.
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  4. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by senkron24 View Post
    bud i want to understand how to if
    Of course you do. Use this https://files.videohelp.com/u/301890/keydump.zip. The content - keydump.py - downloads and examines the first audio fragment for the KID and PSSH.

    thank you for you answer

    i hope its not stupit what i ask becouse i try to with this keydump.py i understand and was befor not know thad we can use the audio for kid or pssh thad was nice info

    bud on the python code

    i get like this error


    python keydump.py

    ----------------------------------------------- key_ID and pssh dumper -----------------------------------------------


    MPD:
    > https://svc40.main.vr.t-online.de/LCID3221228215.originalserver.prod.sngtv.t-online.de...3221228215.mpd
    It cannot find the path specified in the system.
    Traceback (most recent call last):
    File "D:\keydump\keydump.py", line 73, in <module>
    print(f"\n\nkey_ID: {get_kid()}")
    File "D:\keydump\keydump.py", line 44, in get_kid
    mymp4dump = subprocess.Popen([mp4dumpexe, FInput_audio], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
    NameError: name 'FInput_audio' is not defined


    i chack my yt-dlp and its installed teh last version and try to get manuel with this

    yt-dlp -f 'ba' --allow-u --test --no-warnings 'https://svc40.main.vr.t-online.de/LCID3221228215.originalserver.prod.sngtv.t-online.de/PLTV/88888888/224/3221228215/3221228215.mpd'


    and get this result

    yt-dlp -f 'ba' --allow-u --test --no-warnings 'https://svc40.main.vr.t-online.de/LCID3221228215.originalserver.prod.sngtv.t-online.de/PLTV/88888888/224/3221228215/3221228215.mpd'
    [generic] Extracting URL: 'https://svc40.main.vr.t-online.de/LCID3221228215.originalserver.prod.sngtv.t-online.de/PLTV/8888...8215/3221228215.mpd'
    ERROR: [generic] "'https://svc40.main.vr.t-online.de/LCID3221228215.originalserver.prod.sngtv.t-online.de/PLTV/88888888/224/3221228215/3221228215.mpd'" is not a valid URL. Set --default-search "ytsearch" (or run yt-dlp "ytsearch:'https://svc40.main.vr.t-online.de/LCID3221228215.originalserver.prod.sngtv.t-online.de/PLTV/88888888/224/3221228215/3221228215.mpd'" ) to search YouTube


    i not found what i make wrong or what is wrong ?!

    Kind regarts
    Quote Quote  
  5. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    I have no idea of the errors you make.

    Image
    [Attachment 74344 - Click to enlarge]
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  6. Originally Posted by senkron24 View Post
    this is subscription needed for this site?
    I gotten different pssh and kid using my script. like to try to get the key

    Init PSSH: AAAAdXBzc2gBAAAA7e+LqXnWSs6jyCfc1R0h7QAAAAHdEC0yTL mjEuAi/px1yLkFAAAAQQgBEhDdEC0yTLmjEuAi/px1yLkFGhRtYWd5YXJ0ZWxlY29tZ2VybWFueSIOcj01MjAwMTI mcz05NTUqBVNEX0hE
    KID: dd102d324cb9a312e022fe9c75c8b905
    Quote Quote  
  7. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by andrewzhong View Post
    Originally Posted by senkron24 View Post
    this is subscription needed for this site?
    I gotten different pssh and kid using my script. like to try to get the key

    Init PSSH: AAAAdXBzc2gBAAAA7e+LqXnWSs6jyCfc1R0h7QAAAAHdEC0yTL mjEuAi/px1yLkFAAAAQQgBEhDdEC0yTLmjEuAi/px1yLkFGhRtYWd5YXJ0ZWxlY29tZ2VybWFueSIOcj01MjAwMTI mcz05NTUqBVNEX0hE
    KID: dd102d324cb9a312e022fe9c75c8b905
    Is there any point in telling us this, unless you post your script?
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  8. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    i get this with other script becouse it not run with other

    Code:
    url =  https://svc40.main.vr.t-online.de/LCID3221228286.originalserver.prod.sngtv.t-online.de...3221228286.mpd
    psshs =  {
      "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": [
        "AAAAdXBzc2gBAAAA7e+LqXnWSs6jyCfc1R0h7QAAAAG+jCW2U0wZMz9JMUMiInahAAAAQQgBEhC+jCW2U0wZMz9JMUMiInahGhRtYWd5YXJ0ZWxlY29tZ2VybWFueSIOcj01MjAxMjAmcz05NTUqBVNEX0hE"
      ],
      "9a04f079-9840-4286-ab92-e65be0885f95": [
        "AAADgnBzc2gBAAAAmgTweZhAQoarkuZb4IhflQAAAAG+jCW2U0wZMz9JMUMiInahAAADTk4DAAABAAEARAM8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AHQAaQBXAE0AdgBrAHgAVABNAHgAawAvAFMAVABGAEQASQBpAEoAMgBvAFEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AUgBNAGcAZwBYAHQAQgB6AHgAawAwAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AdgBtAHgAZAByAG0AZgBrAGwAYgAxAC4AcwBmAG0ALgB0AC0AbwBuAGwAaQBuAGUALgBkAGUALwBQAGwAYQB5AFIAZQBhAGQAeQAvAHIAaQBnAGgAdABzAG0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwB2AG0AeABkAHIAbQBmAGsAbABiADEALgBzAGYAbQAuAHQALQBvAG4AbABpAG4AZQAuAGQAZQAvAFAAbABhAHkAUgBlAGEAZAB5AC8AcgBpAGcAaAB0AHMAbQBhAG4AYQBnAGUAcgAuAGEAcwBtAHgAPAAvAEwAVQBJAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA=="
      ]
    }


    Code:
    import base64
    import json
    import requests
    import uuid
    import xmlschema
    from http.cookiejar import MozillaCookieJar
    from urllib.parse import urljoin
    
    # Fix MTU fragmentation issues
    from requests.adapters import HTTPAdapter
    from requests.packages.urllib3.util.retry import Retry
    
    requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL'
    
    # Configure max retries globally
    adapter = HTTPAdapter(max_retries=Retry(total=5, backoff_factor=1, status_forcelist=[400, 429, 500, 502, 503, 504]))
    session = requests.Session()
    session.mount("https://", adapter)
    session.mount("http://", adapter)
    
    # Configure proxy if needed (replace None keyword)
    proxy = None  # Examples: proxy = 'socks5h://127.0.0.1:8080'
    if proxy:
        session.proxies = {
            'https': proxy,
            'http': proxy,
        }
    
    # Configure cookies if needed (replace None keyword)
    cookies = None  # Examples: cookies = 'cookies.txt'
    if cookies:
        cj = MozillaCookieJar(cookies)
        cj.load(ignore_discard=True, ignore_expires=True)  # Loads session cookies too (expirydate=0)
        session.cookies = cj
    
    xsd = 'http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd'
    schema = xmlschema.XMLSchema(xsd)
    user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36'
    
    
    def get_pssh_from_data(data):
        pssh_header = bytes([0x70, 0x73, 0x73, 0x68])
        output = {}
        for count, each in enumerate(data):
            if data[count:count + 4] == pssh_header:
                key_system = str(uuid.UUID(bytes=data[count + 8:count + 24]))
                size = int.from_bytes(data[count - 4:count], byteorder='big', signed=False)
                pssh = base64.b64encode(data[count - 4:count + size - 4])
                output.setdefault(key_system, set()).add(pssh)
        return output
    
    
    def process_template(template, representation_id=None, bandwidth=None, time=None, number=None):
        if representation_id is not None:
            result = template.replace('$RepresentationID$', representation_id)
        if number is not None:
            nstart = result.find('$Number')
            if nstart >= 0:
                nend = result.find('$', nstart + 1)
                if nend >= 0:
                    var = result[nstart + 1:nend]
                    if 'Number%' in var:
                        value = var[6:] % (int(number))
                    else:
                        value = number
                    result = result.replace('$' + var + '$', value)
        if bandwidth is not None:
            result = result.replace('$Bandwidth$', bandwidth)
        if time is not None:
            result = result.replace('$Time$', time)
        result = result.replace('$$', '$')
        return result
    
    
    def get_mpd_from_url(url, headers={}):
        body = session.get(url, headers=headers).text
        return xmlschema.to_dict(body, schema=schema, validation='skip', encoding='utf-8')
    
    
    def get_init_urls_from_mpd(url, mpd):
        output = []
        for period in mpd['Period']:
            for adaptation_set in period['AdaptationSet']:
                if 'BaseURL' in period:
                    base_urls = [urljoin(url, x) for x in period['BaseURL']]
                else:
                    base_urls = [url]
                adaptation_segment_template = adaptation_set.get('SegmentTemplate', None)
                for representation in adaptation_set['Representation']:
                    representation_segment_template = representation.get('SegmentTemplate', None)
                    for segment_template in [adaptation_segment_template, representation_segment_template]:
                        if segment_template and '@initialization' in segment_template:
                            initialization = process_template(
                                segment_template['@initialization'], representation_id=str(representation['@id']),
                                bandwidth=str(representation['@bandwidth']))
                            for base_url in base_urls:
                                output.append(urljoin(base_url, initialization))
                    if 'BaseURL' in representation:
                        for base_url in base_urls:
                            for set_url in representation['BaseURL']:
                                output.append(urljoin(base_url, set_url))
        return output
    
    
    def get_pssh_from_inits_urls(input, headers):
        output = {}
        for each in input:
            for key, values in get_pssh_from_data(
                    session.get(each, headers={'range': 'bytes=0-32768'}.update(headers)).content).items():
                output.setdefault(key, set()).update(values)
        return output
    
    
    def get_pssh_from_url(url, headers={}):
        print('url = ', url)
        mpd = get_mpd_from_url(url, headers)
        inits = get_init_urls_from_mpd(url, mpd)
        psshs = get_pssh_from_inits_urls(inits, headers)
        print('psshs = ', json.dumps({key: [value.decode() for value in values] for key, values in psshs.items()},
                                      indent=2))
        return psshs
    
    
    # Check my IP
    if proxy:
        print('My IP is: ', session.get('https://checkip.amazonaws.com').text)
    
    # Examples
    get_pssh_from_url(
        'https://svc40.main.vr.t-online.de/LCID3221228286.originalserver.prod.sngtv.t-online.de/PLTV/88888888/224/3221228286/3221228286.mpd',
        {
            'User-Agent': user_agent,
        })
    Last edited by senkron24; 15th Oct 2023 at 14:16.
    Quote Quote  
  9. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    bud i undertand

    thare two difrend pssh or kid

    mpd is a multi-drm stream which can be decrypted by 2 key systems:

    (widevine) edef8ba9-79d6-4ace-a3c8-27dcd51d21ed

    (fairplay) 9a04f079-9840-4286-ab92-e65be0885f95


    bud still stuck on pssh
    Quote Quote  
  10. Originally Posted by senkron24 View Post
    i get this with other script becouse it not run with other

    Code:
    url =  https://svc40.main.vr.t-online.de/LCID3221228286.originalserver.prod.sngtv.t-online.de...3221228286.mpd
    psshs =  {
      "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": [
        "AAAAdXBzc2gBAAAA7e+LqXnWSs6jyCfc1R0h7QAAAAG+jCW2U0wZMz9JMUMiInahAAAAQQgBEhC+jCW2U0wZMz9JMUMiInahGhRtYWd5YXJ0ZWxlY29tZ2VybWFueSIOcj01MjAxMjAmcz05NTUqBVNEX0hE"
      ],
      "9a04f079-9840-4286-ab92-e65be0885f95": [
        "AAADgnBzc2gBAAAAmgTweZhAQoarkuZb4IhflQAAAAG+jCW2U0wZMz9JMUMiInahAAADTk4DAAABAAEARAM8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AHQAaQBXAE0AdgBrAHgAVABNAHgAawAvAFMAVABGAEQASQBpAEoAMgBvAFEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AUgBNAGcAZwBYAHQAQgB6AHgAawAwAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AdgBtAHgAZAByAG0AZgBrAGwAYgAxAC4AcwBmAG0ALgB0AC0AbwBuAGwAaQBuAGUALgBkAGUALwBQAGwAYQB5AFIAZQBhAGQAeQAvAHIAaQBnAGgAdABzAG0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwB2AG0AeABkAHIAbQBmAGsAbABiADEALgBzAGYAbQAuAHQALQBvAG4AbABpAG4AZQAuAGQAZQAvAFAAbABhAHkAUgBlAGEAZAB5AC8AcgBpAGcAaAB0AHMAbQBhAG4AYQBnAGUAcgAuAGEAcwBtAHgAPAAvAEwAVQBJAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA=="
      ]
    }


    Code:
    import base64
    import json
    import requests
    import uuid
    import xmlschema
    from http.cookiejar import MozillaCookieJar
    from urllib.parse import urljoin
    
    # Fix MTU fragmentation issues
    from requests.adapters import HTTPAdapter
    from requests.packages.urllib3.util.retry import Retry
    
    requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL'
    
    # Configure max retries globally
    adapter = HTTPAdapter(max_retries=Retry(total=5, backoff_factor=1, status_forcelist=[400, 429, 500, 502, 503, 504]))
    session = requests.Session()
    session.mount("https://", adapter)
    session.mount("http://", adapter)
    
    # Configure proxy if needed (replace None keyword)
    proxy = None  # Examples: proxy = 'socks5h://127.0.0.1:8080'
    if proxy:
        session.proxies = {
            'https': proxy,
            'http': proxy,
        }
    
    # Configure cookies if needed (replace None keyword)
    cookies = None  # Examples: cookies = 'cookies.txt'
    if cookies:
        cj = MozillaCookieJar(cookies)
        cj.load(ignore_discard=True, ignore_expires=True)  # Loads session cookies too (expirydate=0)
        session.cookies = cj
    
    xsd = 'http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd'
    schema = xmlschema.XMLSchema(xsd)
    user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36'
    
    
    def get_pssh_from_data(data):
        pssh_header = bytes([0x70, 0x73, 0x73, 0x68])
        output = {}
        for count, each in enumerate(data):
            if data[count:count + 4] == pssh_header:
                key_system = str(uuid.UUID(bytes=data[count + 8:count + 24]))
                size = int.from_bytes(data[count - 4:count], byteorder='big', signed=False)
                pssh = base64.b64encode(data[count - 4:count + size - 4])
                output.setdefault(key_system, set()).add(pssh)
        return output
    
    
    def process_template(template, representation_id=None, bandwidth=None, time=None, number=None):
        if representation_id is not None:
            result = template.replace('$RepresentationID$', representation_id)
        if number is not None:
            nstart = result.find('$Number')
            if nstart >= 0:
                nend = result.find('$', nstart + 1)
                if nend >= 0:
                    var = result[nstart + 1:nend]
                    if 'Number%' in var:
                        value = var[6:] % (int(number))
                    else:
                        value = number
                    result = result.replace('$' + var + '$', value)
        if bandwidth is not None:
            result = result.replace('$Bandwidth$', bandwidth)
        if time is not None:
            result = result.replace('$Time$', time)
        result = result.replace('$$', '$')
        return result
    
    
    def get_mpd_from_url(url, headers={}):
        body = session.get(url, headers=headers).text
        return xmlschema.to_dict(body, schema=schema, validation='skip', encoding='utf-8')
    
    
    def get_init_urls_from_mpd(url, mpd):
        output = []
        for period in mpd['Period']:
            for adaptation_set in period['AdaptationSet']:
                if 'BaseURL' in period:
                    base_urls = [urljoin(url, x) for x in period['BaseURL']]
                else:
                    base_urls = [url]
                adaptation_segment_template = adaptation_set.get('SegmentTemplate', None)
                for representation in adaptation_set['Representation']:
                    representation_segment_template = representation.get('SegmentTemplate', None)
                    for segment_template in [adaptation_segment_template, representation_segment_template]:
                        if segment_template and '@initialization' in segment_template:
                            initialization = process_template(
                                segment_template['@initialization'], representation_id=str(representation['@id']),
                                bandwidth=str(representation['@bandwidth']))
                            for base_url in base_urls:
                                output.append(urljoin(base_url, initialization))
                    if 'BaseURL' in representation:
                        for base_url in base_urls:
                            for set_url in representation['BaseURL']:
                                output.append(urljoin(base_url, set_url))
        return output
    
    
    def get_pssh_from_inits_urls(input, headers):
        output = {}
        for each in input:
            for key, values in get_pssh_from_data(
                    session.get(each, headers={'range': 'bytes=0-32768'}.update(headers)).content).items():
                output.setdefault(key, set()).update(values)
        return output
    
    
    def get_pssh_from_url(url, headers={}):
        print('url = ', url)
        mpd = get_mpd_from_url(url, headers)
        inits = get_init_urls_from_mpd(url, mpd)
        psshs = get_pssh_from_inits_urls(inits, headers)
        print('psshs = ', json.dumps({key: [value.decode() for value in values] for key, values in psshs.items()},
                                      indent=2))
        return psshs
    
    
    # Check my IP
    if proxy:
        print('My IP is: ', session.get('https://checkip.amazonaws.com').text)
    
    # Examples
    get_pssh_from_url(
        'https://svc40.main.vr.t-online.de/LCID3221228286.originalserver.prod.sngtv.t-online.de/PLTV/88888888/224/3221228286/3221228286.mpd',
        {
            'User-Agent': user_agent,
        })
    this script work perfectly
    simple way to get pssh
    thank you senkron24
    Quote Quote  



Similar Threads

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