From 790776e5912f83931701a0fb473ed01b79307b59 Mon Sep 17 00:00:00 2001 From: UrloMythus Date: Fri, 20 Sep 2024 17:20:44 +0200 Subject: [PATCH] Test for faster streams --- Src/API/webru.py | 4 +++- run.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Src/API/webru.py b/Src/API/webru.py index b996dec..2d5a5cf 100644 --- a/Src/API/webru.py +++ b/Src/API/webru.py @@ -55,4 +55,6 @@ async def get_skystreaming(id,client): soup = BeautifulSoup(response.text, 'lxml', parse_only=SoupStrainer('source')) source_tag = soup.find('source') m3u8_url = source_tag.get('src') - return m3u8_url \ No newline at end of file + Host = m3u8_url.replace("https://","").split("/")[0] + print(Host) + return m3u8_url,Host \ No newline at end of file diff --git a/run.py b/run.py index b1c2186..5ffb640 100644 --- a/run.py +++ b/run.py @@ -194,8 +194,8 @@ async def addon_stream(request: Request,config, type, id,): streams['streams'].append({'title':f"{HF}Server {i} " + channel['title'],'url': item}) if id in skystreaming: i = i+1 - url = await get_skystreaming(id,client) - streams['streams'].append({'title': f'{HF}Server {i}', 'url': url, "behaviorHints": {"notWebReady": True, "proxyHeaders": {"request": {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0", "Accept": "*/*", "Accept-Language": "en-US,en;q=0.5", "Origin": "https://skystreaming.guru", "DNT": "1", "Sec-GPC": "1", "Connection": "keep-alive", "Referer": "https://skystreaming.guru/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "cross-site", "Pragma": "no-cache", "Cache-Control": "no-cache", "TE": "trailers"}}}}) + url,Host = await get_skystreaming(id,client) + streams['streams'].append({'title': f'{HF}Server {i}', 'url': url, "behaviorHints": {"notWebReady": True, "proxyHeaders": {"request": {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0", "Accept": "*/*", "Accept-Language": "en-US,en;q=0.5", "Origin": "https://skystreaming.guru", "DNT": "1", "Sec-GPC": "1", "Connection": "keep-alive", "Referer": "https://skystreaming.guru/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "cross-site", "Pragma": "no-cache", "Cache-Control": "no-cache", "TE": "trailers","Host": Host}}}}) if id in webru_vary: i = i+1