"""Shared provider configuration constants for AniWorld providers.

Centralizes user-agent strings, provider lists and common headers so
multiple provider implementations can import a single source of truth.
"""
from enum import Enum
from typing import Dict, List


class ProviderType(str, Enum):
    """Enumeration of supported video providers."""
    VOE = "VOE"
    DOODSTREAM = "Doodstream"
    VIDMOLY = "Vidmoly"
    VIDOZA = "Vidoza"
    SPEEDFILES = "SpeedFiles"
    STREAMTAPE = "Streamtape"
    LULUVDO = "Luluvdo"


DEFAULT_PROVIDERS: List[str] = [
    ProviderType.VOE.value,
    ProviderType.DOODSTREAM.value,
    ProviderType.VIDMOLY.value,
    ProviderType.VIDOZA.value,
    ProviderType.SPEEDFILES.value,
    ProviderType.STREAMTAPE.value,
    ProviderType.LULUVDO.value,
]

ANIWORLD_HEADERS: Dict[str, str] = {
    "accept": (
        "text/html,application/xhtml+xml,application/xml;q=0.9,"
        "image/avif,image/webp,image/apng,*/*;q=0.8"
    ),
    "accept-encoding": "gzip, deflate, br, zstd",
    "accept-language": (
        "de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
    ),
    "cache-control": "max-age=0",
    "priority": "u=0, i",
    "sec-ch-ua": (
        '"Chromium";v="136", "Microsoft Edge";v="136", '
        '"Not.A/Brand";v="99"'
    ),
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": '"Windows"',
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "none",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1",
    "user-agent": (
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
        "AppleWebKit/537.36 (KHTML, like Gecko) "
        "Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0"
    ),
}

INVALID_PATH_CHARS: List[str] = [
    "<",
    ">",
    ":",
    '"',
    "/",
    "\\",
    "|",
    "?",
    "*",
    "&",
]

LULUVDO_USER_AGENT = (
    "Mozilla/5.0 (Android 15; Mobile; rv:132.0) "
    "Gecko/132.0 Firefox/132.0"
)

# Default download timeout (seconds)
DEFAULT_DOWNLOAD_TIMEOUT = 600
