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

@@ -1,8 +1,7 @@
import re
import string
from typing import Dict, Any
from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError
from mediaflow_proxy.utils.packed import eval_solver
class MixdropExtractor(BaseExtractor):
@@ -12,23 +11,10 @@ class MixdropExtractor(BaseExtractor):
"""Extract Mixdrop URL."""
if "club" in url:
url = url.replace("club", "ps").split("/2")[0]
response = await self._make_request(url, headers={"accept-language": "en-US,en;q=0.5"})
# Extract and decode URL
match = re.search(r"}\('(.+)',.+,'(.+)'\.split", response.text)
if not match:
raise ExtractorError("Failed to extract URL components")
headers = {"accept-language": "en-US,en;q=0.5"}
s1, s2 = match.group(1, 2)
schema = s1.split(";")[2][5:-1]
terms = s2.split("|")
# Build character mapping
charset = string.digits + string.ascii_letters
char_map = {charset[i]: terms[i] or charset[i] for i in range(len(terms))}
# Construct final URL
final_url = "https:" + "".join(char_map.get(c, c) for c in schema)
final_url = f"https:{await eval_solver(self, url, headers, r'MDCore.wurl ?= ?"(.*?)"')}"
self.base_headers["referer"] = url
return {