import logging

# Configuration centrale du script
TIMEOUT = 15                          # Timeout pour les requêtes HTTP (secondes)
MAX_WORKERS = 5                       # Nombre maximal de threads pour le traitement parallèle
DELAY = 0.5                           # Délai entre chaque requête (secondes)
USER_AGENT = (
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
    "AppleWebKit/537.36 (KHTML, like Gecko) "
    "Chrome/91.0.4472.124 Safari/537.36"
)
BLACKLIST = ["lien-brise.com", "autre-lien.com"]

# Patterns pour l'extraction des liens
LINK_PATTERNS = [
    r'(link:)?https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}\b(?:[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)',
    r'video::([A-Za-z0-9_\-]{11})',
]

# Configuration du logging
LOGGING_CONFIG = {
    "level": logging.INFO,
    "format": "%(message)s",
    "handlers": [logging.StreamHandler()],
}

# Configuration des retries pour les requêtes HTTP
RETRY_CONFIG = {
    "total": 3,
    "backoff_factor": 1,
    "status_forcelist": [500, 502, 503, 504],
}
