SonglistApi
modules.songlist.SonglistApi
Bases: ApiModule
歌单相关 API.
Source code in qqmusic_api/modules/_base.py
get_detail
get_detail(
songlist_id: int,
dirid: int = 0,
num: int = 10,
page: int = 1,
*,
onlysong: bool = False,
tag: bool = True,
userinfo: bool = True,
)
获取歌单详细信息和歌曲原始数据.
| PARAMETER | DESCRIPTION |
|---|---|
songlist_id
|
歌单 ID.
TYPE:
|
dirid
|
目录 ID (可选).
TYPE:
|
num
|
返回歌曲数量.
TYPE:
|
page
|
页码.
TYPE:
|
onlysong
|
是否仅返回歌曲列表.
TYPE:
|
tag
|
是否返回标签信息.
TYPE:
|
userinfo
|
是否返回用户信息.
TYPE:
|
Source code in qqmusic_api/modules/songlist.py
create
create(
dirname: str, *, credential: Credential | None = None
)
创建歌单.
Note
重名歌单并不会创建失败, 服务端会自动添加时间戳.
| PARAMETER | DESCRIPTION |
|---|---|
dirname
|
歌单名称.
TYPE:
|
credential
|
登录凭证.
TYPE:
|
Source code in qqmusic_api/modules/songlist.py
delete
delete(dirid: int, *, credential: Credential | None = None)
删除歌单.
Note
删除不存在歌单时返回的 dirid 为 0
| PARAMETER | DESCRIPTION |
|---|---|
dirid
|
歌单目录 ID.
TYPE:
|
credential
|
登录凭证.
TYPE:
|
Source code in qqmusic_api/modules/songlist.py
add_songs
async
add_songs(
dirid: int,
song_info: list[tuple[int, int]],
*,
tid: int = 0,
credential: Credential | None = None,
) -> bool
添加歌曲到歌单.
| PARAMETER | DESCRIPTION |
|---|---|
dirid
|
歌单目录 ID.
TYPE:
|
song_info
|
歌曲信息列表, 每项为 |
tid
|
歌单 TID.
TYPE:
|
credential
|
登录凭证.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
操作成功与否 (歌曲已存在于歌单中也返回 True). |
Source code in qqmusic_api/modules/songlist.py
del_songs
async
del_songs(
dirid: int,
song_info: list[tuple[int, int]],
*,
tid: int = 0,
credential: Credential | None = None,
) -> bool
删除歌单中的歌曲.
| PARAMETER | DESCRIPTION |
|---|---|
dirid
|
歌单目录 ID.
TYPE:
|
song_info
|
歌曲信息列表, 每项为 |
tid
|
歌单 TID.
TYPE:
|
credential
|
登录凭证.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
操作成功与否 (歌曲不存在于歌单中也返回 True). |