fix(yandex): support /track/ID url regex and live reload volume
This commit is contained in:
1 parent
9de3affc32
commit
b36445d203
3 files changed
+10
-1
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ def on_startup():
|
||||
|
||||
@app.get("/")
|
||||
def read_root(request: Request):
|
||||
return templates.TemplateResponse("index.html", {"request": request})
|
||||
return templates.TemplateResponse(request=request, name="index.html")
|
||||
|
||||
@app.post("/api/download")
|
||||
async def start_download(req: DownloadRequest):
|
||||
|
||||
@@ -54,6 +54,14 @@ class YandexMusicProvider(BaseProvider):
|
||||
meta = self._convert_track(t)
|
||||
return [meta] if meta else []
|
||||
|
||||
# Direct track match: /track/123
|
||||
direct_track = re.search(r'/track/(\d+)', url)
|
||||
if direct_track:
|
||||
track_id = direct_track.group(1)
|
||||
t = client.tracks([track_id])[0]
|
||||
meta = self._convert_track(t)
|
||||
return [meta] if meta else []
|
||||
|
||||
# Album match: /album/123
|
||||
album_match = re.search(r'/album/(\d+)', url)
|
||||
if album_match:
|
||||
|
||||
@@ -8,5 +8,6 @@ services:
|
||||
volumes:
|
||||
- /home/ai-projects/services/music.qpid.pro/music:/music
|
||||
- ./data:/app/data
|
||||
- ./app:/app/app
|
||||
env_file:
|
||||
- .env
|
||||
Reference in new issue
Block a user