Fix API endpoints: resource IDs in URL path, not query params
- artists/{artist_id}/tracks and /direct-albums: artistID in path, return ArtistTracks/ArtistAlbums with pager
- likes: /users/me/likes/{type}s/{add-multiple|remove}, IDs as body params
- queue: /queues/{queue_id}/... instead of /queue/...?queue_id=...
- radio: /rotor/station/{station_id}/info and /tracks
- concerts: /concerts/{concert_id}/info, /concerts/tab-config
- playlists: /users/{user_id}/playlists
- labels: /labels/{label_id}, /albums, /artists
- clips: /clips/will/like, /artists/{artist_id}/blocks/artist-clips
- feed: /landing3/* endpoints
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
02a6dabcfb
commit
70c2a5cd01
12 files changed
+238
-168
No files matched your search
@@ -2,6 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"gitea.mrixs.me/Mrixs/yandex-music-api-go/internal/models"
|
||||
)
|
||||
@@ -73,13 +74,14 @@ func (c *Client) GetGeneratedPlaylists(ctx context.Context) ([]*models.Generated
|
||||
}
|
||||
|
||||
// GetLanding gets a landing page
|
||||
// GET /landing3/{landingID}
|
||||
func (c *Client) GetLanding(ctx context.Context, landingID string) (*models.Landing, error) {
|
||||
params := map[string]string{
|
||||
"landing_id": landingID,
|
||||
}
|
||||
|
||||
var result models.Landing
|
||||
if err := c.request.Get(ctx, "/landing", params, &result); err != nil {
|
||||
if err := c.request.Get(ctx, fmt.Sprintf("/landing3/%s", landingID), params, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
@@ -88,7 +90,7 @@ func (c *Client) GetLanding(ctx context.Context, landingID string) (*models.Land
|
||||
// GetLandingList gets a list of landings
|
||||
func (c *Client) GetLandingList(ctx context.Context) (*models.LandingList, error) {
|
||||
var result models.LandingList
|
||||
if err := c.request.Get(ctx, "/landing/list", nil, &result); err != nil {
|
||||
if err := c.request.Get(ctx, "/landing3/list", nil, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
@@ -101,7 +103,7 @@ func (c *Client) GetLandingBlocks(ctx context.Context, blockIDs []string) ([]*mo
|
||||
}
|
||||
|
||||
var result []models.LandingBlock
|
||||
if err := c.request.Get(ctx, "/landing/blocks", params, &result); err != nil {
|
||||
if err := c.request.Get(ctx, "/landing3/blocks", params, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user