|
from pydantic_settings import BaseSettings |
|
|
|
|
|
class Settings(BaseSettings): |
|
""" |
|
Settings and configuration for the application. |
|
|
|
For sensitive information, use environment variables in .env file. |
|
""" |
|
|
|
|
|
app_version: str = "0.3.1" |
|
|
|
|
|
download_path: str = "download" |
|
|
|
|
|
|
|
redis_tls: int = 0 |
|
|
|
|
|
celery_broker_host: str = "celery-redis" |
|
celery_backend_host: str = "celery-redis" |
|
|
|
|
|
celery_broker_user: str = "" |
|
celery_backend_user: str = "" |
|
|
|
|
|
celery_broker_password: str = "pass123" |
|
celery_backend_password: str = "pass123" |
|
|
|
|
|
celery_broker_port: int = 6379 |
|
celery_backend_port: int = 6379 |
|
|
|
|
|
celery_broker_db: int = 0 |
|
celery_backend_db: int = 1 |
|
|
|
|
|
celery_retry_max: int = 5 |
|
celery_retry_delay: int = 10 |
|
|
|
default_proxy: str = "https://pipedapi.kavin.rocks" |
|
|
|
|
|
piped_proxy: str = "https://pipedproxy-yyz" |
|
|
|
|
|
class Config: |
|
env_file = ".env" |
|
|
|
|
|
class TestSettings(BaseSettings): |
|
""" |
|
Settings and configuration for testing the application. |
|
|
|
Defaults set here, but can be overridden by environment variables in .env file. |
|
""" |
|
|
|
test_download_path: str = "download" |
|
|
|
invalid_video_id: str = "invalid_video_id" |
|
valid_video_id: str = "valid_video_id" |
|
|
|
class Config: |
|
env_file = ".env.test" |
|
|