This commit is contained in:
2026-01-03 21:23:55 -08:00
parent 73f3005393
commit 3acf21a673
10 changed files with 1244 additions and 43 deletions

View File

@@ -18,6 +18,7 @@ class HifiApiClient:
- GET /search/ with exactly one of s, a, v, p
- GET /track/ with id (and optional quality)
- GET /info/ with id
- GET /album/ with id
- GET /lyrics/ with id
"""
@@ -68,6 +69,18 @@ class HifiApiClient:
return self._get_json("info/", params={"id": track_int})
def album(self, album_id: int) -> Dict[str, Any]:
"""Fetch album details, including track list when provided by the backend."""
try:
album_int = int(album_id)
except Exception as exc:
raise HifiApiError(f"album_id must be int-compatible: {exc}") from exc
if album_int <= 0:
raise HifiApiError("album_id must be positive")
return self._get_json("album/", params={"id": album_int})
def lyrics(self, track_id: int) -> Dict[str, Any]:
"""Fetch lyrics (including subtitles/LRC) for a track."""