VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    its just working example viaplay link


    i try to found pssh bud not get the right one

    kid :4D3FFEAB-C79F-553B-BCF3-828A6C186AD4
    convert pssh : AAAAAHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISEE0//qvHn1U7vPOCimwYatQ=


    bud this pssh its not coreckt or mybe its not good inuf
    i try with init yt-dlp still not good
    have any idea how to get the right pssh ?

    kind regarts
    Last edited by senkron24; 19th Mar 2024 at 14:03.
    Quote Quote  
  2. Try this:
    Code:
    AAAAWXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADkIARIQTT/+q8efVTu884KKbBhq1BoHdmlhcGxheSIY968c9a3678cc4a62b780e9f03e04921dMgA=
    Quote Quote  
  3. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    Originally Posted by white_snake View Post
    Try this:
    Code:
    AAAAWXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADkIARIQTT/+q8efVTu884KKbBhq1BoHdmlhcGxheSIY968c9a3678cc4a62b780e9f03e04921dMgA=


    wawww great work
    bud can you explain pls how to
    Quote Quote  
  4. Member
    Join Date
    Aug 2023
    Location
    Turkey
    Search Comp PM
    ohh i find out thank you for you answer ...

    here its the code i was early use for otehr platforum ...

    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_CIPHER S += ':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://live-b-dash-cdn7-tve.cdn.viaplay.tv/tve/vfactiondk/vfactiondk.isml/index.mpd',
    {
    'User-Agent': user_agent,
    })
    Quote Quote  



Similar Threads

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