From 5f53c9ec82a5080c687b203fe63deafa9d8daf50 Mon Sep 17 00:00:00 2001 From: UrloMythus Date: Thu, 19 Sep 2024 19:04:26 +0200 Subject: [PATCH] Fixed Sports --- Src/API/webru.py | 9 +++------ run.py | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Src/API/webru.py b/Src/API/webru.py index 50481db..b996dec 100644 --- a/Src/API/webru.py +++ b/Src/API/webru.py @@ -42,7 +42,6 @@ async def webru(id,site,client): mediaproxy = config.MediaProxy medialink = random.choice(mediaproxy) new_stream_url = f'{medialink}proxy/hls?key_url=https%3A%2F%2Fkey.mizhls.ru%2F&api_password={MEDIAFLOW_PASS}&d={stream_url}&h_Referer={Referer}&h_Origin={Origin}&h_User-Agent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F58.0.3029.110%20Safari%2F537.3' - print(new_stream_url) return new_stream_url except Exception as e: print("WebRu failed",e) @@ -54,8 +53,6 @@ async def get_skystreaming(id,client): skystreaming_link = skystreaming[id] response = await client.get(skystreaming_link, headers=headers, allow_redirects=True, impersonate = "chrome120") soup = BeautifulSoup(response.text, 'lxml', parse_only=SoupStrainer('source')) - m3u8_url = soup.get('src') - start = m3u8_url.find('//') + 2 - end = m3u8_url.find('/', start) - Host = m3u8_url[start:end] - return m3u8_url,Host \ No newline at end of file + source_tag = soup.find('source') + m3u8_url = source_tag.get('src') + return m3u8_url \ No newline at end of file diff --git a/run.py b/run.py index 46de254..b1c2186 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, host = get_skystreaming(id,client) - streams['streams'].append({'title': f'{HF}Server {i}', 'url': url, 'behaviorHints': {'proxyHeaders': {"request": {"Referer": "https://skystreaming.guru/", "Origin": "https://skystreaming.guru", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36", "Accept": "*/*", "Accept-Language": "it-IT,it;q=0.9", "Host": host}}, 'notWebReady': True}}) + 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"}}}}) if id in webru_vary: i = i+1