Spaces:
Paused
Paused
Download config.py from ttnikal/Filesharing: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/spaces/ttnikal/Filesharing/resolve/main/config.py
- Command line
-
hf download hf://spaces/ttnikal/Filesharing/config.py
-
curl -L -o config.py https://huggingface.co/spaces/ttnikal/Filesharing/resolve/main/config.py
631 Bytes
| import os | |
| # Use absolute path for UPLOAD_DIR to ensure reliability across different environments | |
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| UPLOAD_DIR = os.path.abspath(os.getenv("UPLOAD_DIR", os.path.join(BASE_DIR, "uploads"))) | |
| API_ID = os.getenv("API_ID") | |
| API_HASH = os.getenv("API_HASH") | |
| BOT_TOKEN = os.getenv("BOT_TOKEN") or os.getenv("TELEGRAM_TOKEN") | |
| BASE_URL = os.getenv("BASE_URL", "https://ttnikal-filesharing.hf.space").rstrip("/") | |
| if not os.path.exists(UPLOAD_DIR): | |
| os.makedirs(UPLOAD_DIR, exist_ok=True) | |
| # Ensure it's writable | |
| try: | |
| os.chmod(UPLOAD_DIR, 0o777) | |
| except: | |
| pass | |