Commit
·
49ea85c
1
Parent(s):
78ec209
patch 2
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from Instance import Instance
|
|
| 6 |
from api import LoadBalancerAPI
|
| 7 |
import os
|
| 8 |
import aiofiles
|
|
|
|
| 9 |
|
| 10 |
# Constants and Configuration
|
| 11 |
CACHE_DIR = os.getenv("CACHE_DIR")
|
|
@@ -95,9 +96,10 @@ async def get_media_store_api():
|
|
| 95 |
"""Endpoint to get the music store JSON."""
|
| 96 |
return JSONResponse(instance.MUSIC_STORE)
|
| 97 |
|
| 98 |
-
@app.get("/api/get/music/{
|
| 99 |
-
async def get_media_api(request: Request,
|
| 100 |
"""Endpoint to get the music file (audio or video) by title with support for range requests."""
|
|
|
|
| 101 |
if not title:
|
| 102 |
raise HTTPException(status_code=400, detail="Title parameter is required")
|
| 103 |
|
|
|
|
| 6 |
from api import LoadBalancerAPI
|
| 7 |
import os
|
| 8 |
import aiofiles
|
| 9 |
+
from urllib.parse import unquote
|
| 10 |
|
| 11 |
# Constants and Configuration
|
| 12 |
CACHE_DIR = os.getenv("CACHE_DIR")
|
|
|
|
| 96 |
"""Endpoint to get the music store JSON."""
|
| 97 |
return JSONResponse(instance.MUSIC_STORE)
|
| 98 |
|
| 99 |
+
@app.get("/api/get/music/{filename}")
|
| 100 |
+
async def get_media_api(request: Request, filename: str):
|
| 101 |
"""Endpoint to get the music file (audio or video) by title with support for range requests."""
|
| 102 |
+
title = unquote(filename)
|
| 103 |
if not title:
|
| 104 |
raise HTTPException(status_code=400, detail="Title parameter is required")
|
| 105 |
|