mirror of
https://github.com/UrloMythus/UnHided.git
synced 2026-06-10 09:10:23 +00:00
new version
This commit is contained in:
@@ -9,7 +9,7 @@ import json
|
||||
import logging
|
||||
|
||||
from mediaflow_proxy.configs import settings
|
||||
from mediaflow_proxy.utils.http_client import create_aiohttp_session
|
||||
from mediaflow_proxy.utils.http_client import create_aiohttp_session, _ensure_routing_initialized, get_routing_config
|
||||
from mediaflow_proxy.utils.http_utils import DownloadError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -65,6 +65,16 @@ class BaseExtractor(ABC):
|
||||
# merge incoming headers (e.g. Accept-Language / Referer) with default base headers
|
||||
self.base_headers.update(request_headers or {})
|
||||
|
||||
@staticmethod
|
||||
def _get_proxy(url: str) -> str | None:
|
||||
"""Return the configured proxy URL for *url*, or None if no proxy applies."""
|
||||
try:
|
||||
_ensure_routing_initialized()
|
||||
route = get_routing_config().match_url(url)
|
||||
return route.proxy_url
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
async def _make_request(
|
||||
self,
|
||||
url: str,
|
||||
|
||||
Reference in New Issue
Block a user