ChandimaPrabath commited on
Commit
49ea85c
·
1 Parent(s): 78ec209
Files changed (1) hide show
  1. app.py +4 -2
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/{title}")
99
- async def get_media_api(request: Request, title: str):
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