Singer
歌手相关Api
/**
* @brief 区域类型枚举
*/
enum class AreaType : int {
ALL = -100,
CHINA = 200,
TAIWAN = 2,
AMERICA = 5,
JAPAN = 4,
KOREA = 3
};
/**
* @brief 风格类型枚举
*/
enum class GenreType : int {
ALL = -100,
POP = 7,
RAP = 3,
CHINESE_STYLE = 19,
ROCK = 4,
ELECTRONIC = 2,
FOLK = 8,
R_AND_B = 11,
ETHNIC = 37,
LIGHT_MUSIC = 93,
JAZZ = 14,
CLASSICAL = 33,
COUNTRY = 13,
BLUES = 10
};
/**
* @brief 性别类型枚举
* */
enum class GenderType : int {
ALL = -100,
MALE = 0,
FEMALE = 1,
GROUP = 2,
};
/**
* @brief 索引类型枚举, 按首字母筛选时需要
* */
enum class IndexType : int {
A = 1,
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
HASH,
ALL = -100
};
Class qqmusic::TabType
标签类
#include <singer.h>
Public Types
Type | Name |
---|---|
enum | Type 标签类型枚举 |
Public Functions
Type | Name |
---|---|
TabType () = delete 使用枚举值初始化标签类 |
|
TabType (Type type) |
|
std::string | get_id () const 获取tab id |
std::string | get_name () const 获取tab名称 |
Public Types Documentation
enum Type
标签类型枚举
enum qqmusic::TabType::Type {
WIKI,
ALBUM,
COMPOSER,
LYRICIST,
PRODUCER,
ARRANGER,
MUSICIAN,
SONG,
VIDEO
};
Public Functions Documentation
function TabType [1/2]
使用枚举值初始化标签类
Parameters:
type
标签类型枚举
Exception:
若提供的枚举值不合法
function TabType [2/2]
function get_id
获取tab id
Returns:
std::string格式tab id
function get_name
获取tab名称
Returns:
std::string格式tab name
The documentation for this class was generated from the following file include/qqmusic/singer.h
function get_singer_list
获取符合筛选条件的歌手信息表单
Task< Result < nlohmann::json > > qqmusic::get_singer_list (
AreaType area=AreaType::ALL,
GenderType gender=GenderType::ALL,
GenreType genre=GenreType::ALL
)
获取JSON格式的歌手信息, 可以使用area, gender和genre筛选
Parameters:
area
区域信息筛选, 默认AreaType::ALL
.gender
性别信息筛选, 默认GenderType::ALL
.genre
风格信息筛选, 默认GenreType::ALL
.
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
See also: AreaType, GenderType, GenreType
Note:
异步函数, 返回Task
function get_songs_list_all
获取歌手的所有歌曲
Parameters:
mid
歌手mid
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_singer_list_index
筛选获得歌曲歌单原始数据
Task< Result < nlohmann::json > > qqmusic::get_singer_list_index (
AreaType area=AreaType::ALL,
GenderType gender=GenderType::ALL,
GenreType genre=GenreType::ALL,
IndexType index=IndexType::ALL,
unsigned sin=0,
unsigned cur_page=1
)
Parameters:
area
区域信息筛选, 默认AreaType::ALL
.gender
性别信息筛选, 默认GenderType::ALL
.genre
风格信息筛选, 默认GenreType::ALL
.sin
跳过的条目数量, 默认0
cur_page
当前页面的索引, 默认1
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
See also: AreaType, GenderType, GenreType, IndexType
Note:
异步函数, 返回Task
function get_singer_list_index_all
获取所有符合条件的歌单原始数据
Task< Result < nlohmann::json > > qqmusic::get_singer_list_index_all (
AreaType area=AreaType::ALL,
GenderType gender=GenderType::ALL,
GenreType genre=GenreType::ALL,
IndexType index=IndexType::ALL
)
Parameters:
area
区域信息筛选, 默认AreaType::ALL
.gender
性别信息筛选, 默认GenderType::ALL
.genre
风格信息筛选, 默认GenreType::ALL
.index
索引信息筛选, 默认IndexType::ALL
.
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
See also: AreaType, GenderType, GenreType, IndexType
Note:
异步函数, 返回Task
function get_singer_info
获取歌手基本信息
Parameters:
歌手mid
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_singer_desc
获取多个歌手的简介
Task< Result < nlohmann::json > > qqmusic::get_singer_desc (
std::span< std::string > mids,
unsigned number=10
)
Parameters:
mids
歌手mid列表number
相似歌手数量, 默认为0
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
See also: TabType
Note:
异步函数, 返回Task
function get_tab_detail
返回标签详细信息
Task< Result < nlohmann::json > > qqmusic::get_tab_detail (
std::string_view mid,
TabType type,
unsigned page=1,
unsigned num=10
)
Parameters:
mid
歌手midtype
标签信息page
页码num
每页返回数量
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
See also: TabType
Note:
异步函数, 返回Task
function get_similar_singers
获取相似歌手信息
Task< Result < nlohmann::json > > qqmusic::get_similar_singers (
std::string_view mid,
unsigned number=10
)
Parameters:
mids
歌手midnumber
相似歌手数量, 默认为0
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
See also: TabType
Note:
异步函数, 返回Task
function get_songs_list
获取歌手歌曲原始数据
Task< Result < nlohmann::json > > qqmusic::get_songs_list (
std::string_view mid,
unsigned num=10,
unsigned begin=0
)
Parameters:
mid
歌手midnum
每次获取的最大数量, 默认10
, 最大30
begin
从第几个开始
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_songs_list_all
获取歌手的所有歌曲
Parameters:
mid
歌手mid
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_album_list
获取歌手专辑列表
Task< Result < nlohmann::json > > qqmusic::get_album_list (
std::string_view mid,
unsigned number=10,
unsigned begin=0
)
Parameters:
mid
歌手midnumber
单次获取数据量, 默认10
begin
从第几个开始
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_album_list_all
获取歌手所有专辑
Parameters:
mid
歌手mid
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_mv_list
获取歌手MV列表
Task< Result < nlohmann::json > > qqmusic::get_mv_list (
std::string_view mid,
unsigned number=10,
unsigned begin=0
)
Parameters:
mid
歌手midnumber
单次获取数据量, 默认10
begin
从第几个开始
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task
function get_mv_list_all
获取歌手所有MV
Parameters:
mid
歌手mid
Returns:
包含正确JSON格式结果的Task< Result <nlohmann::json>>
. 如果产生错误, 返回值包含错误结果和错误类型枚举
Note:
异步函数, 返回Task