Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,9 @@ import logging
|
|
| 13 |
import gc
|
| 14 |
from typing import Dict, Any
|
| 15 |
import cloudscraper
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
-
tmp_dir = tempfile.gettempdir()
|
| 19 |
-
|
| 20 |
logging.basicConfig(level=logging.INFO)
|
| 21 |
logger = logging.getLogger(__name__)
|
| 22 |
|
|
@@ -28,6 +27,7 @@ app = FastAPI()
|
|
| 28 |
|
| 29 |
# Define a global temporary download directory
|
| 30 |
global_download_dir = tempfile.mkdtemp()
|
|
|
|
| 31 |
|
| 32 |
# Rate limiting dictionary
|
| 33 |
class RateLimiter:
|
|
|
|
| 13 |
import gc
|
| 14 |
from typing import Dict, Any
|
| 15 |
import cloudscraper
|
| 16 |
+
from fastapi.staticfiles import StaticFiles
|
| 17 |
|
| 18 |
|
|
|
|
|
|
|
| 19 |
logging.basicConfig(level=logging.INFO)
|
| 20 |
logger = logging.getLogger(__name__)
|
| 21 |
|
|
|
|
| 27 |
|
| 28 |
# Define a global temporary download directory
|
| 29 |
global_download_dir = tempfile.mkdtemp()
|
| 30 |
+
app.mount("/file", StaticFiles(directory=global_download_dir), name="downloads")
|
| 31 |
|
| 32 |
# Rate limiting dictionary
|
| 33 |
class RateLimiter:
|