mirror of
https://github.com/UrloMythus/UnHided.git
synced 2026-04-11 11:50:51 +00:00
Add files via upload
This commit is contained in:
24
mediaflow_proxy/speedtest/providers/base.py
Normal file
24
mediaflow_proxy/speedtest/providers/base.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict, Tuple, Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
from mediaflow_proxy.speedtest.models import UserInfo
|
||||
|
||||
|
||||
class SpeedTestProviderConfig(BaseModel):
|
||||
test_duration: int = 10 # seconds
|
||||
test_urls: Dict[str, str]
|
||||
|
||||
|
||||
class BaseSpeedTestProvider(ABC):
|
||||
"""Base class for speed test providers."""
|
||||
|
||||
@abstractmethod
|
||||
async def get_test_urls(self) -> Tuple[Dict[str, str], Optional[UserInfo]]:
|
||||
"""Get list of test URLs for the provider and optional user info."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_config(self) -> SpeedTestProviderConfig:
|
||||
"""Get provider-specific configuration."""
|
||||
pass
|
||||
Reference in New Issue
Block a user