new version

This commit is contained in:
UrloMythus
2026-04-15 19:23:14 +02:00
parent 5120b19d0b
commit 8134936d59
135 changed files with 3013 additions and 1589 deletions
+25 -8
View File
@@ -1,22 +1,39 @@
import re
from typing import Dict
from typing import Dict, Any
from urllib.parse import urljoin
from curl_cffi.requests import AsyncSession
from mediaflow_proxy.extractors.base import BaseExtractor, ExtractorError
class UqloadExtractor(BaseExtractor):
"""Uqload URL extractor."""
"""Uqload URL extractor.
async def extract(self, url: str, **kwargs) -> Dict[str, str]:
"""Extract Uqload URL."""
response = await self._make_request(url)
Uses curl_cffi + Chrome impersonation to handle Cloudflare protection.
Follows redirects automatically (uqload.bz/co/io all redirect to uqload.is).
"""
video_url_match = re.search(r'sources: \["(.*?)"]', response.text)
async def extract(self, url: str, **kwargs) -> Dict[str, Any]:
proxy = self._get_proxy(url)
async with AsyncSession() as session:
response = await session.get(
url,
impersonate="chrome",
timeout=30,
allow_redirects=True,
**({"proxy": proxy} if proxy else {}),
)
if response.status_code >= 400:
raise ExtractorError(f"HTTP {response.status_code} while fetching {url}")
video_url_match = re.search(r'sources:\s*\["(https?://[^"]+)"', response.text)
if not video_url_match:
raise ExtractorError("Failed to extract video URL")
raise ExtractorError("Uqload: video URL not found in page source")
self.base_headers["referer"] = urljoin(url, "/")
final_url = str(response.url)
self.base_headers["referer"] = urljoin(final_url, "/")
return {
"destination_url": video_url_match.group(1),
"request_headers": self.base_headers,