Update app.py
Browse files
app.py
CHANGED
@@ -230,13 +230,13 @@ def download_track(request: Request, download_request: DownloadRequest):
|
|
230 |
|
231 |
# Pydantic model for album request
|
232 |
class AlbumRequest(BaseModel):
|
233 |
-
|
234 |
|
235 |
|
236 |
# Fetch album data
|
237 |
@app.post("/z_album")
|
238 |
def fetch_album(request: AlbumRequest):
|
239 |
-
album_id = request.
|
240 |
try:
|
241 |
response = requests.get(f"{DEEZER_API_URL}/album/{album_id}")
|
242 |
response.raise_for_status()
|
@@ -262,13 +262,13 @@ def fetch_album(request: AlbumRequest):
|
|
262 |
|
263 |
# Pydantic model for playlist request
|
264 |
class PlaylistRequest(BaseModel):
|
265 |
-
|
266 |
|
267 |
|
268 |
# Fetch playlist data
|
269 |
@app.post("/z_playlist")
|
270 |
def fetch_playlist(request: PlaylistRequest):
|
271 |
-
playlist_id = request.
|
272 |
try:
|
273 |
response = requests.get(f"{DEEZER_API_URL}/playlist/{playlist_id}")
|
274 |
response.raise_for_status()
|
|
|
230 |
|
231 |
# Pydantic model for album request
|
232 |
class AlbumRequest(BaseModel):
|
233 |
+
id: str
|
234 |
|
235 |
|
236 |
# Fetch album data
|
237 |
@app.post("/z_album")
|
238 |
def fetch_album(request: AlbumRequest):
|
239 |
+
album_id = request.id
|
240 |
try:
|
241 |
response = requests.get(f"{DEEZER_API_URL}/album/{album_id}")
|
242 |
response.raise_for_status()
|
|
|
262 |
|
263 |
# Pydantic model for playlist request
|
264 |
class PlaylistRequest(BaseModel):
|
265 |
+
id: str
|
266 |
|
267 |
|
268 |
# Fetch playlist data
|
269 |
@app.post("/z_playlist")
|
270 |
def fetch_playlist(request: PlaylistRequest):
|
271 |
+
playlist_id = request.id
|
272 |
try:
|
273 |
response = requests.get(f"{DEEZER_API_URL}/playlist/{playlist_id}")
|
274 |
response.raise_for_status()
|