This commit is contained in:
UrloMythus
2025-07-18 09:51:51 +02:00
parent e1b7376b8b
commit abf282c770
10 changed files with 16 additions and 167 deletions

View File

@@ -142,15 +142,15 @@ class UnpackingError(Exception):
async def eval_solver(self, url: str, headers):
async def eval_solver(self, url: str, headers, pattern: str) -> str:
try:
response = await self._make_request(url, headers = headers)
response = await self._make_request(url, headers=headers)
soup = BeautifulSoup(response.text, "lxml",parse_only=SoupStrainer("script"))
script_all = soup.find_all("script")
for i in script_all:
if detect(i.text):
unpacked_code = unpack(i.text)
match = re.search( r'file:"(.*?)"', unpacked_code)
match = re.search(pattern, unpacked_code)
if match:
m3u8_url = match.group(1)
return m3u8_url