62 lines
1.6 KiB
Python
62 lines
1.6 KiB
Python
from pydantic_settings import BaseSettings
|
|
from typing import Optional
|
|
from pathlib import Path
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings."""
|
|
|
|
# Bot
|
|
BOT_TOKEN: str = ""
|
|
TELEGRAM_PROXY: str = "" # socks5://user:pass@host:port
|
|
ADMIN_PASSWORD: str = ""
|
|
|
|
# Telethon/MTProto settings
|
|
API_ID: int = 12345
|
|
API_HASH: str = "abc123"
|
|
|
|
# IRC Configuration
|
|
IRC_SERVER: str = "irc.chat.twitch.tv"
|
|
IRC_PORT: int = 6697 # SSL port
|
|
IRC_USERNAME: str = "justinfan12345"
|
|
IRC_OAUTH: str = "oauth:12345"
|
|
|
|
# Browser Configuration
|
|
VIEWPORT_WIDTH: int = 1366
|
|
VIEWPORT_HEIGHT: int = 768
|
|
|
|
# Default values
|
|
DEFAULT_MIN_DELAY: int = 30
|
|
DEFAULT_MAX_DELAY: int = 60
|
|
DEFAULT_MIN_READING: int = 45
|
|
DEFAULT_MAX_READING: int = 90
|
|
DEFAULT_VISITS_PER_LINK: int = 2
|
|
DEFAULT_MONITOR_MINUTES: int = 60
|
|
MTPROTO_SECRET: str = "00000000000000000000000000000000"
|
|
# Timing
|
|
MAX_REDIRECT_WAIT: int = 30
|
|
MAX_RECONNECTS: int = 10
|
|
PONG_TIMEOUT: int = 300
|
|
SOCKET_TIMEOUT: int = 30
|
|
RECV_TIMEOUT: float = 5.0
|
|
|
|
# Proxy
|
|
PROXY_FILE: str = "proxies.txt"
|
|
PROXY_COOLDOWN_TIME: int = 30
|
|
PROXY_MAX_USAGE_BEFORE_COOLDOWN: int = 5
|
|
|
|
# Screenshots
|
|
SCREENSHOTS_DIR: str = ""
|
|
|
|
# Logging
|
|
LOG_LEVEL: str = "INFO"
|
|
LOG_FILE: str = "logs/bot.log"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
case_sensitive = True
|
|
extra = "ignore" # Игнорировать лишние поля из .env
|
|
|
|
|
|
settings = Settings() |