mirror of
https://git.unlock-music.dev/um/cli.git
synced 2025-07-06 22:42:12 +08:00
feat(qmc): support audio meta getter
This commit is contained in:
21
algo/qmc/client/cover.go
Normal file
21
algo/qmc/client/cover.go
Normal file
@ -0,0 +1,21 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func (c *QQMusic) AlbumCoverByID(ctx context.Context, albumID int) ([]byte, error) {
|
||||
u := fmt.Sprintf("https://imgcache.qq.com/music/photo/album/%s/albumpic_%s_0.jpg",
|
||||
strconv.Itoa(albumID%100),
|
||||
strconv.Itoa(albumID),
|
||||
)
|
||||
return c.downloadFile(ctx, u)
|
||||
}
|
||||
|
||||
func (c *QQMusic) AlbumCoverByMediaID(ctx context.Context, mediaID string) ([]byte, error) {
|
||||
// original: https://y.gtimg.cn/music/photo_new/T002M000%s.jpg
|
||||
u := fmt.Sprintf("https://y.gtimg.cn/music/photo_new/T002R500x500M000%s.jpg", mediaID)
|
||||
return c.downloadFile(ctx, u)
|
||||
}
|
Reference in New Issue
Block a user