New Version

This commit is contained in:
UrloMythus
2025-07-09 23:54:35 +02:00
parent 7a1e96d8b1
commit abd330e83f
49 changed files with 212 additions and 22 deletions

View File

@@ -2,22 +2,24 @@ import re
from typing import Dict, Any
from mediaflow_proxy.extractors.base import BaseExtractor
from mediaflow_proxy.utils.packed import eval_solver
class SupervideoExtractor(BaseExtractor):
"""Supervideo URL extractor."""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.mediaflow_endpoint = "hls_manifest_proxy"
async def extract(self, url: str, **kwargs) -> Dict[str, Any]:
"""Extract Supervideo URL."""
response = await self._make_request(url)
# Extract and decode URL
s2 = re.search(r"\}\('(.+)',.+,'(.+)'\.split", response.text).group(2)
terms = s2.split("|")
hfs = next(terms[i] for i in range(terms.index("file"), len(terms)) if "hfs" in terms[i])
result = terms[terms.index("urlset") + 1 : terms.index("hls")]
#Init headers needed for the request.
headers = {'Accept': '*/*', 'Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.71 Mobile Safari/537.36', 'user-agent': 'Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.71 Mobile Safari/537.36'}
base_url = f"https://{hfs}.serversicuro.cc/hls/"
final_url = base_url + ",".join(reversed(result)) + (".urlset/master.m3u8" if result else "")
"""Extract Supervideo URL."""
final_url = await eval_solver(self,url,headers)
self.base_headers["referer"] = url
return {