-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathconstants.py
More file actions
27 lines (21 loc) · 940 Bytes
/
constants.py
File metadata and controls
27 lines (21 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
constants.py
Central configuration module for YouTube Audio Converter API.
Defines paths, token settings, and HTTP response codes.
Crafted with precision by Alperen Sümeroğlu — powering clean and configurable logic.
"""
import os
from pathlib import Path
# --- Directory Configurations ---
ROOT_DIRECTORY = Path(__file__).resolve().parent
DOWNLOADS_DIRECTORY = 'downloads'
ABS_DOWNLOADS_PATH = str(ROOT_DIRECTORY / DOWNLOADS_DIRECTORY)
# --- HTTP Response Codes ---
REQUEST_TIMEOUT = 408 # Used when token is expired
UNAUTHORIZED = 401 # Used when token is invalid
NOT_FOUND = 404 # File not found on server
BAD_REQUEST = 400 # Missing parameters in request
INTERNAL_SERVER_ERROR = 500 # Fallback for unexpected server errors
# --- Token Settings ---
EXPIRY_TIME_MINUTES = 5 # Token expiration duration in minutes
TOKEN_LENGTH = 20 # Length of generated token (in characters)