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
+ Reply to Thread
Results 1 to 4 of 4
-
Last edited by senkron24; 19th Mar 2024 at 14:03.
-
Try this:
Code:AAAAWXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADkIARIQTT/+q8efVTu884KKbBhq1BoHdmlhcGxheSIY968c9a3678cc4a62b780e9f03e04921dMgA=
-
-
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,
})
Similar Threads
-
pssh help
By rominhos in forum Video Streaming DownloadingReplies: 14Last Post: 15th Nov 2023, 10:28 -
how to get pssh ?
By senkron24 in forum Video Streaming DownloadingReplies: 10Last Post: 17th Oct 2023, 10:09 -
Different PSSH in mpd, EME logger and PSSH Box Generator
By Kevste in forum Video Streaming DownloadingReplies: 4Last Post: 31st May 2023, 22:24 -
How to get the PSSH?
By Anonymousdk01 in forum Video Streaming DownloadingReplies: 2Last Post: 28th Mar 2023, 10:06 -
get pssh
By tere1579 in forum Video Streaming DownloadingReplies: 6Last Post: 1st Dec 2022, 22:35