From 3aeb71907b50f4e22233e615d860a99389a87dc5 Mon Sep 17 00:00:00 2001 From: UrloMythus Date: Tue, 19 May 2026 20:30:02 +0200 Subject: [PATCH] Update streamhg --- Src/API/extractors/streamhg.py | 24 +++++++++++++++++------- Src/API/guardahd.py | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Src/API/extractors/streamhg.py b/Src/API/extractors/streamhg.py index df06d5d..e346669 100644 --- a/Src/API/extractors/streamhg.py +++ b/Src/API/extractors/streamhg.py @@ -2,6 +2,7 @@ import Src.Utilities.config as config from Src.Utilities.eval import eval_solver import logging from Src.Utilities.config import setup_logging +from Src.Utilities.mfp import build_mfp level = config.LEVEL logger = setup_logging(level) Icon = config.Icon @@ -10,15 +11,24 @@ Name = config.Name -async def streamhg(link,client,streams, site_name, proxies,ForwardProxy): +async def streamhg(link,client,MFP,MFP_CREDENTIALS,streams, site_name, proxies,ForwardProxy): link = 'https://audinifer.com/e/' + link.split('/e/')[1] - url = await eval_solver(link,proxies, ForwardProxy, client,r'"hls2":"([^"]+)"') - if url: - streams['streams'].append({'name': f"{Name}",'title': f'{Icon}{site_name}\n▶️ StreamHG', 'url': url, 'behaviorHints': {'bingeGroup': f'{site_name.lower()}'}}) + if MFP == '1': + url = await build_mfp(MFP_CREDENTIALS,link,"StreamHG",client) logger.info(f"{site_name} on StreamHG found results for the current ID") - status = True + if url: + status = True + streams['streams'].append({'name': f"{Name} 🕵️‍♂️",'title': f'{Icon}{site_name}\n▶️ StreamHG', 'url': url, 'behaviorHints':{'bingeGroup': f'{site_name.lower()}'}}) + else: + status = False else: - status = False + url = await eval_solver(link,proxies, ForwardProxy, client,r'"hls2":"([^"]+)"') + if url: + streams['streams'].append({'name': f"{Name}",'title': f'{Icon}{site_name}\n▶️ StreamHG', 'url': url, 'behaviorHints': {'bingeGroup': f'{site_name.lower()}'}}) + logger.info(f"{site_name} on StreamHG found results for the current ID") + status = True + else: + status = False return streams,status @@ -27,7 +37,7 @@ async def streamhg(link,client,streams, site_name, proxies,ForwardProxy): async def test_streamhg(): from curl_cffi.requests import AsyncSession async with AsyncSession() as client: - results = await streamhg("https://dhcplay.com/e/zctlgpn3zoll",client,{'streams': []}, "StreamHG", {},"") + results = await streamhg("https://dhcplay.com/e/zctlgpn3zoll",client,"1",['',''],{'streams': []}, "StreamHG", {},"") print(results) if __name__ == "__main__": import asyncio diff --git a/Src/API/guardahd.py b/Src/API/guardahd.py index bc1f7e1..e0d02c4 100644 --- a/Src/API/guardahd.py +++ b/Src/API/guardahd.py @@ -60,7 +60,7 @@ async def guardahd(streams,id,client,MFP,MFP_CREDENTIALS): results = await search(clean_id,client) status = False if 'streamhg' in results: - streams,status = await streamhg(results['streamhg'], client,streams,"GuardaHD",proxies, ForwardProxy) + streams,status = await streamhg(results['streamhg'], client,MFP,MFP_CREDENTIALS,streams,"GuardaHD",proxies, ForwardProxy) if 'mixdrop' in results and not status: streams,status = await mixdrop(results['mixdrop'],client,MFP,MFP_CREDENTIALS,streams,"GuardaHD",proxies,ForwardProxy,'') return streams