v0.1.0 — Réécriture complète de OhmStreaming
Nouvelle version réécrite de zéro : recherche multi-sources (Vostfree, French-Manga), extraction 2 niveaux, proxy vidéo intégré, streaming/téléchargement HLS, métadonnées Kitsu, bibliothèque locale, comptes JWT + administration, découverte fusionnée, indexeur Torznab (Sonarr/Prowlarr).
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_prefix="OHM_", env_file=".env", extra="ignore")
|
||||
|
||||
app_name: str = "Ohm Stream Downloader"
|
||||
debug: bool = False
|
||||
|
||||
# Données
|
||||
data_dir: Path = BASE_DIR / "data"
|
||||
download_dir: Path = BASE_DIR / "downloads"
|
||||
database_path: Path = BASE_DIR / "data" / "ohm.db"
|
||||
|
||||
# Sécurité — à surcharger via OHM_SECRET_KEY en production
|
||||
secret_key: str = "change-me-in-production"
|
||||
access_token_ttl_minutes: int = 15
|
||||
refresh_token_ttl_days: int = 30
|
||||
|
||||
# Scraping
|
||||
http_timeout: float = 20.0
|
||||
user_agent: str = "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
|
||||
scrapers_config_dir: Path = BASE_DIR / "app" / "scrapers" / "configs"
|
||||
|
||||
# Téléchargements
|
||||
max_parallel_downloads: int = 3
|
||||
|
||||
# Kitsu
|
||||
kitsu_base_url: str = "https://kitsu.io/api/edge"
|
||||
metadata_cache_ttl_hours: int = 72
|
||||
|
||||
def ensure_dirs(self) -> None:
|
||||
self.data_dir.mkdir(parents=True, exist_ok=True)
|
||||
self.download_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
settings = Settings()
|
||||
settings.ensure_dirs()
|
||||
return settings
|
||||
Reference in New Issue
Block a user