28 lines
750 B
Python
28 lines
750 B
Python
import os
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
YANDEX_MUSIC_TOKEN: str = ""
|
|
MUSIC_DIR: str = "/music"
|
|
DATA_DIR: str = "/app/data"
|
|
NAVIDROME_URL: str = "https://music.qpid.pro"
|
|
NAVIDROME_USER: str = ""
|
|
NAVIDROME_PASSWORD: str = ""
|
|
DOWNLOAD_LYRICS: bool = True
|
|
AUDIO_FORMAT: str = "mp3"
|
|
AUDIO_BITRATE: str = "320k"
|
|
HOST: str = "0.0.0.0"
|
|
PORT: int = 8005
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
extra = "ignore"
|
|
|
|
settings = Settings()
|
|
|
|
# Ensure directories exist
|
|
os.makedirs(settings.MUSIC_DIR, exist_ok=True)
|
|
os.makedirs(settings.DATA_DIR, exist_ok=True)
|
|
os.makedirs(os.path.join(settings.DATA_DIR, "tmp"), exist_ok=True)
|