Neo2902 commited on
Commit ·
b15fddc
1
Parent(s): 0549d36
Projet complet avec chunking, extract_playlist et youtube_search
Browse files
app.py
CHANGED
|
@@ -43,9 +43,10 @@ async def extract(request: Request):
|
|
| 43 |
playlist_url = data.get("playlistUrl")
|
| 44 |
if not playlist_url:
|
| 45 |
return JSONResponse(status_code=400, content={"message": "Playlist URL manquante"})
|
| 46 |
-
|
| 47 |
try:
|
| 48 |
-
songs = await extract_playlist_playwright.extract_playlist(playlist_url)
|
|
|
|
| 49 |
return {"message": f"{len(songs)} morceaux extraits.", "playlist": songs}
|
| 50 |
except Exception as e:
|
| 51 |
return JSONResponse(status_code=500, content={"message": f"Erreur extraction : {str(e)}"})
|
|
|
|
|
|
| 43 |
playlist_url = data.get("playlistUrl")
|
| 44 |
if not playlist_url:
|
| 45 |
return JSONResponse(status_code=400, content={"message": "Playlist URL manquante"})
|
|
|
|
| 46 |
try:
|
| 47 |
+
songs = await extract_playlist_playwright.extract_playlist(playlist_url)
|
| 48 |
+
# Renvoi brut, liste des morceaux avec title + artist
|
| 49 |
return {"message": f"{len(songs)} morceaux extraits.", "playlist": songs}
|
| 50 |
except Exception as e:
|
| 51 |
return JSONResponse(status_code=500, content={"message": f"Erreur extraction : {str(e)}"})
|
| 52 |
+
|