mirror of
https://github.com/UrloMythus/UnHided.git
synced 2026-04-09 02:40:47 +00:00
HF fixed
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -1,21 +1,8 @@
|
||||
FROM python:3.10-slim-buster
|
||||
|
||||
# Set the working directory in the container to /app
|
||||
FROM python:3.11-slim-bullseye
|
||||
WORKDIR /app
|
||||
|
||||
# Install git
|
||||
RUN apt-get update && apt-get install -y git
|
||||
|
||||
# Clone the repository
|
||||
RUN git clone https://github.com/YourUsername/YourRepoName.git .
|
||||
|
||||
# Copy the local config.json file to the container
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
EXPOSE 7860
|
||||
CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
|
||||
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
# Run run.py when the container launches
|
||||
CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "8888", "--workers", "4"]
|
||||
|
||||
@@ -30,7 +30,6 @@ class BaseExtractor(ABC):
|
||||
try:
|
||||
async with create_httpx_client() as client:
|
||||
request_headers = self.base_headers
|
||||
print(request_headers)
|
||||
request_headers.update(headers or {})
|
||||
response = await client.request(
|
||||
method,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import re
|
||||
from typing import Dict, Any
|
||||
|
||||
from mediaflow_proxy.extractors.base import BaseExtractor
|
||||
@@ -17,10 +16,10 @@ class FastreamExtractor(BaseExtractor):
|
||||
#Init headers needed for the request.
|
||||
headers = {'Accept': '*/*', 'Connection': 'keep-alive','Accept-Language': 'en-US,en;q=0.5','Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0'}
|
||||
"""Extract Fastream URL."""
|
||||
final_url = await eval_solver(self,url,headers)
|
||||
final_url = await eval_solver(self,url,headers, r'file:"(.*?)"')
|
||||
|
||||
self.base_headers["referer"] = f'https://{url.replace('https://','').split('/')[0]}/'
|
||||
self.base_headers["origin"] = f'https://{url.replace('https://','').split('/')[0]}'
|
||||
self.base_headers["referer"] = f'https://{url.replace("https://","").split("/")[0]}/'
|
||||
self.base_headers["origin"] = f'https://{url.replace("https://","").split("/")[0]}'
|
||||
self.base_headers['Accept-Language'] = 'en-US,en;q=0.5'
|
||||
self.base_headers['Accept'] = '*/*'
|
||||
self.base_headers['user-agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0'
|
||||
@@ -29,4 +28,4 @@ class FastreamExtractor(BaseExtractor):
|
||||
"destination_url": final_url,
|
||||
"request_headers": self.base_headers,
|
||||
"mediaflow_endpoint": self.mediaflow_endpoint,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -19,7 +19,7 @@ class SupervideoExtractor(BaseExtractor):
|
||||
|
||||
|
||||
"""Extract Supervideo URL."""
|
||||
final_url = await eval_solver(self,url,headers)
|
||||
final_url = await eval_solver(self,url,headers, r'file:"(.*?)"')
|
||||
|
||||
self.base_headers["referer"] = url
|
||||
return {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,125 +1,3 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MediaFlow Proxy</title>
|
||||
<link rel="icon" href="/logo.png" type="image/x-icon">
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
header {
|
||||
background-color: #90aacc;
|
||||
color: #fff;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header img {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
vertical-align: middle;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
display: inline;
|
||||
margin-left: 20px;
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
.feature {
|
||||
background-color: #f4f4f4;
|
||||
border-left: 4px solid #3498db;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.speed-test-section {
|
||||
background-color: #e8f4fd;
|
||||
border-left: 4px solid #2196f3;
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.speed-test-links {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
margin-top: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.speed-test-link {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #2196f3;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.speed-test-link:hover {
|
||||
background-color: #1976d2;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.speed-test-link.browser {
|
||||
background-color: #4caf50;
|
||||
}
|
||||
|
||||
.speed-test-link.browser:hover {
|
||||
background-color: #388e3c;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #3498db;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<img src="/logo.png" alt="MediaFlow Proxy Logo">
|
||||
<h1>MediaFlow Proxy</h1>
|
||||
</header>
|
||||
<p>A high-performance proxy server for streaming media, supporting HTTP(S), HLS, and MPEG-DASH with real-time DRM decryption.</p>
|
||||
|
||||
<h2>Key Features</h2>
|
||||
<div class="feature">Convert MPEG-DASH streams (DRM-protected and non-protected) to HLS</div>
|
||||
<div class="feature">Support for Clear Key DRM-protected MPD DASH streams</div>
|
||||
<div class="feature">Handle both live and video-on-demand (VOD) DASH streams</div>
|
||||
<div class="feature">Proxy HTTP/HTTPS links with custom headers</div>
|
||||
<div class="feature">Proxy and modify HLS (M3U8) streams in real-time with custom headers and key URL modifications for bypassing some sneaky restrictions.</div>
|
||||
<div class="feature">Protect against unauthorized access and network bandwidth abuses</div>
|
||||
|
||||
<div class="speed-test-section">
|
||||
<h3>🚀 Speed Test Tool</h3>
|
||||
<p>Test your connection speed with debrid services to optimize your streaming experience:</p>
|
||||
<div class="speed-test-links">
|
||||
<a href="/speedtest" class="speed-test-link browser">Browser Speed Test</a>
|
||||
</div>
|
||||
<p style="margin-top: 10px; font-size: 14px; color: #666;">
|
||||
<strong>Browser Speed Test:</strong> Tests your actual connection speed through MediaFlow proxy vs direct connection with support for multiple servers, interactive charts, and comprehensive analytics.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2>Getting Started</h2>
|
||||
<p>Visit the <a href="https://github.com/mhdzumair/mediaflow-proxy">GitHub repository</a> for installation instructions and documentation.</p>
|
||||
|
||||
<h2>Premium Hosted Service</h2>
|
||||
<p>For a hassle-free experience, check out <a href="https://store.elfhosted.com/product/mediaflow-proxy">premium hosted service on ElfHosted</a>.</p>
|
||||
|
||||
<h2>API Documentation</h2>
|
||||
<p>Explore the <a href="/docs">Swagger UI</a> for comprehensive details about the API endpoints and their usage.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<p>"The App is running"</p>
|
||||
</html>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user