跳转至

Namespace qqmusic

Namespace List > qqmusic

Namespaces

Type Name
namespace crypto
namespace details
namespace utils
简易Cookie管理器, 负责cookie的序列化和反序列化, 依赖 nlohmann::json 实现 目前不支持路径嵌套和Expires HttpOnly 这样的特性

Classes

Type Name
class BaseMediaFileType
媒体文件类型基类
class EncryptedSongFileType
加密歌曲文件类型
struct Lyric
歌词
struct MvUrl
Mv url封裝
struct PhoneLoginResult
struct QRCode
二维码信息
class QRCodeLoginEvent
二维码登陆事件
struct QRCodeLoginResult
二维码登陆结果封装
class SongFileType
未加密的歌曲文件类枚举
struct SongInfo
class TabType
标签类

Public Types

Type Name
enum int AreaType
区域类型枚举
enum int CoverSize
封面类型枚举
enum int GenderType
性别类型枚举
enum int GenreType
风格类型枚举
enum int IndexType
索引类型枚举, 按首字母筛选时需要
enum int PhoneLoginEvent
手机号登陆状态枚举
enum QRLoginType
登陆类型枚举
typedef Result< T, qqmusic::utils::Exception > Result
Rust风格的返回结果封装, 正确结果和异常共用同一个渠道返回
enum unsigned SearchType
搜索类型枚举
typedef boost::asio::awaitable< T > Task
通用异步任务

Public Functions

Type Name
qqmusic::Task< qqmusic::Result< QRCodeLoginResult > > check_qq_qr (QRCode & qrc)
检查QQ二维码状态
qqmusic::Task< qqmusic::Result< QRCodeLoginResult > > check_wx_qr (QRCode & qrc)
检查微信二维码状态
Task< Result< nlohmann::json > > general_search (std::string_view keyword, unsigned num=15, unsigned page=1, bool highlight=true)
综合搜索
std::string get_album_cover_url (std::string_view mid, CoverSize size)
获取专辑封面url
Task< Result< nlohmann::json > > get_album_detail (std::string_view album_mid)
从mid获取专辑信息
Task< Result< nlohmann::json > > get_album_detail (uint64_t album_id)
从id获取专辑信息
Task< Result< nlohmann::json > > get_album_list (std::string_view mid, unsigned number=10, unsigned begin=0)
获取歌手专辑列表
Task< Result< nlohmann::json > > get_album_list_all (std::string_view mid)
获取歌手所有专辑
Task< Result< nlohmann::json > > get_album_songs (std::string_view album_mid, unsigned int num=10, unsigned int page=1)
从mid获取专辑歌曲列表
Task< Result< nlohmann::json > > get_album_songs (uint64_t album_id, unsigned int num=10, unsigned int page=1)
从id获取专辑歌曲列表
Task< Result< nlohmann::json > > get_created_songlist (uint64_t musicid, std::optional< utils::Credential > credential=std::nullopt)
获取创建的歌单列表
Task< Result< std::string > > get_euin (uint64_t musicid)
由musicid获取euin
Task< Result< nlohmann::json > > get_fans (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
粉丝数量
Task< Result< nlohmann::json > > get_fav_album (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取收藏专辑
Task< Result< nlohmann::json > > get_fav_mv (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取收藏MV
Task< Result< nlohmann::json > > get_fav_num (std::span< uint64_t > id_list, bool readable=true)
获取歌曲的收藏量
Task< Result< nlohmann::json > > get_fav_song (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取收藏歌曲
Task< Result< nlohmann::json > > get_fav_songlist (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取收藏歌单
Task< Result< nlohmann::json > > get_follow_singers (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取关注的歌手列表
Task< Result< nlohmann::json > > get_follow_usr (std::string_view euin, unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取关注用户列表
Task< Result< nlohmann::json > > get_friend_list (unsigned page=1, unsigned num=10, std::optional< utils::Credential > credential=std::nullopt)
获取好友列表
Task< Result< nlohmann::json > > get_homepage (std::string_view euin, std::optional< utils::Credential > credential=std::nullopt)
获取用户主页信息
Task< Result< nlohmann::json > > get_labels (uint64_t songid)
获取歌曲标签信息
Task< Result< Lyric > > get_lyric (std::string_view mid, bool qrc=false, bool trans=false, bool roma=false)
获取歌曲的歌词
Task< Result< Lyric > > get_lyric (uint64_t id, bool qrc=false, bool trans=false, bool roma=false)
获取歌曲的歌词
Task< Result< nlohmann::json > > get_music_gene (std::string_view euin, std::optional< utils::Credential > credential=std::nullopt)
获取音乐基因
Task< Result< uint64_t > > get_musicid (std::string_view euin)
由euin获取musicid
Task< Result< nlohmann::json > > get_mv_detail (std::span< std::string > vids)
获取一组MV的信息
Task< Result< nlohmann::json > > get_mv_list (std::string_view mid, unsigned number=10, unsigned begin=0)
获取歌手MV列表
Task< Result< nlohmann::json > > get_mv_list_all (std::string_view mid)
获取歌手所有MV
Task< Result< std::vector< MvUrl > > > get_mv_urls (std::span< std::string > vids)
获取mv url
Task< Result< nlohmann::json > > get_other_version (std::string_view mid)
获取同名歌曲的其他版本
Task< Result< nlohmann::json > > get_other_version (uint64_t id)
获取同名歌曲的其他版本
Task< Result< nlohmann::json > > get_producer_info (std::string_view mid)
获取歌曲制作者信息
Task< Result< nlohmann::json > > get_producer_info (uint64_t id)
获取歌曲制作者信息
qqmusic::Task< qqmusic::Result< QRCode > > get_qrcode (QRLoginType login_type)
获取登陆二维码
Task< Result< nlohmann::json > > get_related_mv (uint64_t songid, std::optional< std::string > last_mvid=std::nullopt)
获取相关MV
Task< Result< nlohmann::json > > get_related_songlist (uint64_t songid)
获取相关歌单列表
Task< Result< nlohmann::json > > get_sheet (std::string_view mid)
获取曲谱信息
Task< Result< nlohmann::json > > get_similar_singers (std::string_view mid, unsigned number=10)
获取相似歌手信息
Task< Result< nlohmann::json > > get_similar_songs (uint64_t songid)
获取相似歌曲列表
Task< Result< nlohmann::json > > get_singer_desc (std::span< std::string > mids, unsigned number=10)
获取多个歌手的简介
Task< Result< nlohmann::json > > get_singer_info (std::string_view mid)
获取歌手基本信息
Task< Result< nlohmann::json > > get_singer_list (AreaType area=AreaType::ALL, GenderType gender=GenderType::ALL, GenreType genre=GenreType::ALL)
获取符合筛选条件的歌手信息表单
Task< Result< nlohmann::json > > 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)
筛选获得歌曲歌单原始数据
Task< Result< nlohmann::json > > get_singer_list_index_all (AreaType area=AreaType::ALL, GenderType gender=GenderType::ALL, GenreType genre=GenreType::ALL, IndexType index=IndexType::ALL)
获取所有符合条件的歌单原始数据
Task< Result< nlohmann::json > > get_song_detail (std::string_view mid)
获取歌曲详细信息
Task< Result< nlohmann::json > > get_song_detail (uint64_t id)
获取歌曲详细信息
Task< Result< std::vector< SongInfo > > > get_song_urls (std::span< std::string > mids, std::unique_ptr< BaseMediaFileType > file_type=std::make_unique< SongFileType >(), std::optional< utils::Credential > credential=std::nullopt)
批量获取歌曲播放链接
Task< Result< nlohmann::json > > get_songlist (uint64_t dissid, unsigned dirid=0)
获取歌单列表
Task< Result< nlohmann::json > > get_songlist_detail (uint64_t dissid, unsigned dirid=0, unsigned num=10, unsigned page=1, bool only_song=false, bool tag=true, bool user_info=true)
获取歌单信息
Task< Result< nlohmann::json > > get_songs_list (std::string_view mid, unsigned num=10, unsigned begin=0)
获取歌手歌曲原始数据
Task< Result< nlohmann::json > > get_songs_list_all (std::string_view mid)
获取歌手的所有歌曲
Task< Result< nlohmann::json > > get_tab_detail (std::string_view mid, TabType type, unsigned page=1, unsigned num=10)
返回标签详细信息
Task< Result< nlohmann::json > > get_toplist_category ()
获取所有排行榜
Task< Result< nlohmann::json > > get_toplist_item_detail (unsigned top_id, unsigned num=10, unsigned page=1, bool tag=true)
获取排行榜条目信息
Task< Result< std::string > > get_try_url (std::string_view mid, std::string_view vs)
获取试听链接
Task< Result< nlohmann::json > > get_vip_info (std::optional< utils::Credential > credential=std::nullopt)
获取当前账号vip信息
Task< Result< nlohmann::json > > hotkey ()
获取搜索热词
Task< Result< nlohmann::json > > keyword_complete (std::string_view keyword)
搜索词联想补全
qqmusic::Task< qqmusic::Result< utils::Credential > > phone_authorize (std::string_view phone, std::string_view auth_code, std::string_view country_code="86")
手机号认证
Task< Result< nlohmann::json > > query_song (std::span< std::string > mids)
批量查询歌曲信息
Task< Result< nlohmann::json > > query_song (std::span< uint64_t > ids)
批量查询歌曲信息
Task< Result< nlohmann::json > > quick_search (std::string_view keyword)
快速搜索
Task< Result< nlohmann::json > > search_by_type (std::string_view keyword, SearchType type=SearchType::SONG, unsigned num_per_page=10, unsigned page=1, bool highlight=true)
按类型搜索
qqmusic::Task< qqmusic::Result< PhoneLoginResult > > send_authcode (std::string_view phone, std::string_view country_code="86")
向指定手机号发送验证码
Task< Result< bool > > songlist_add_songs (uint64_t dirid, std::span< uint64_t > song_ids, std::optional< utils::Credential > credential=std::nullopt)
向歌单内添加歌曲
Task< Result< nlohmann::json > > songlist_create (std::string_view dirname, std::optional< utils::Credential > credential=std::nullopt)
创建歌单
Task< Result< bool > > songlist_delete (uint64_t dirid, std::optional< utils::Credential > credential=std::nullopt)
删除歌单
Task< Result< bool > > songlist_delete_songs (uint64_t dirid, std::span< uint64_t > song_ids, std::optional< utils::Credential > credential=std::nullopt)
删除歌单内指定歌曲

Public Types Documentation

enum AreaType

区域类型枚举

enum qqmusic::AreaType {
    ALL = -100,
    CHINA = 200,
    TAIWAN = 2,
    AMERICA = 5,
    JAPAN = 4,
    KOREA = 3
};


enum CoverSize

封面类型枚举

enum qqmusic::CoverSize {
    SMALL = 150,
    DEFAULT = 300,
    MIDIUM = 500,
    LARGE = 800
};


enum GenderType

性别类型枚举

enum qqmusic::GenderType {
    ALL = -100,
    MALE = 0,
    FEMALE = 1,
    GROUP = 2
};


enum GenreType

风格类型枚举

enum qqmusic::GenreType {
    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
};


enum IndexType

索引类型枚举, 按首字母筛选时需要

enum qqmusic::IndexType {
    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
};


enum PhoneLoginEvent

手机号登陆状态枚举

enum qqmusic::PhoneLoginEvent {
    SEND = 0,
    CAPTCHA = 20276,
    FREQUENCY = 100001,
    OTHER = -1
};


enum QRLoginType

登陆类型枚举

enum qqmusic::QRLoginType {
    QQ,
    WX
};


typedef Result

Rust风格的返回结果封装, 正确结果和异常共用同一个渠道返回

using qqmusic::Result = typedef Result<T, qqmusic::utils::Exception>;

使用方法:

Result<int> func(int a);

int main() {
    auto res = func(114514);
    if (res.isErr()) {
        // error occurred in func, unwrap the error
        std::cout << res.unwrapErr().what() << std::endl;
    }
    // func returned normally, unwrap the result
    int x = res.unwrap();
    return 0;
}


enum SearchType

搜索类型枚举

enum qqmusic::SearchType {
    SONG = 0,
    SINGER = 1,
    ALBUM = 2,
    SONG_LIST = 3,
    MV = 4,
    LYRIC = 7,
    USER = 8,
    AUDIO_ALBUM = 15,
    AUDIO = 18
};


typedef Task

通用异步任务

using qqmusic::Task = typedef boost::asio::awaitable<T>;


Public Functions Documentation

function check_qq_qr

检查QQ二维码状态

qqmusic::Task< qqmusic::Result< QRCodeLoginResult > > qqmusic::check_qq_qr (
    QRCode & qrc
) 

Parameters:

  • qrc QQ二维码

Returns:

包含正确结果的Task< Result < QRCodeLoginResult >>. 如果登陆成功会包含Credential

Note:

异步函数, 返回Task


function check_wx_qr

检查微信二维码状态

qqmusic::Task< qqmusic::Result< QRCodeLoginResult > > qqmusic::check_wx_qr (
    QRCode & qrc
) 

Parameters:

  • qrc 微信二维码

Returns:

包含正确结果的Task< Result < QRCodeLoginResult >>. 如果登陆成功会包含Credential

Note:

异步函数, 返回Task


综合搜索

Task< Result < nlohmann::json > > qqmusic::general_search (
    std::string_view keyword,
    unsigned num=15,
    unsigned page=1,
    bool highlight=true
) 

Parameters:

  • keyword 搜索词
  • num 每页结果数, 默认15
  • page 页数, 默认1
  • highlight 是否高亮, 默认true

Returns:

Json格式搜索结果

Note:

异步函数, 返回Task


function get_album_cover_url

获取专辑封面url

std::string qqmusic::get_album_cover_url (
    std::string_view mid,
    CoverSize size
) 

Parameters:

  • mid 歌曲mid
  • size 歌曲封面尺寸

Returns:

std::string格式歌曲封面的url


function get_album_detail

从mid获取专辑信息

Task< Result < nlohmann::json > > qqmusic::get_album_detail (
    std::string_view album_mid
) 

Parameters:

  • album_mid 专辑mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_album_detail

从id获取专辑信息

Task< Result < nlohmann::json > > qqmusic::get_album_detail (
    uint64_t album_id
) 

Parameters:

  • album_id 专辑id

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 歌手mid
  • number 单次获取数据量, 默认10
  • begin 从第几个开始

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_album_list_all

获取歌手所有专辑

Task< Result < nlohmann::json > > qqmusic::get_album_list_all (
    std::string_view mid
) 

Parameters:

  • mid 歌手mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_album_songs

从mid获取专辑歌曲列表

Task< Result < nlohmann::json > > qqmusic::get_album_songs (
    std::string_view album_mid,
    unsigned int num=10,
    unsigned int page=1
) 

Parameters:

  • album_mid 专辑mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_album_songs

从id获取专辑歌曲列表

Task< Result < nlohmann::json > > qqmusic::get_album_songs (
    uint64_t album_id,
    unsigned int num=10,
    unsigned int page=1
) 

Parameters:

  • album_id 专辑id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_created_songlist

获取创建的歌单列表

Task< Result < nlohmann::json > > qqmusic::get_created_songlist (
    uint64_t musicid,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • musicid
  • credential 凭据信息

function get_euin

由musicid获取euin

Task< Result < std::string > > qqmusic::get_euin (
    uint64_t musicid
) 

Parameters:

  • musicid MusicID, 通常是QQ号

Returns:

Euin


function get_fans

粉丝数量

Task< Result < nlohmann::json > > qqmusic::get_fans (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_fav_album

获取收藏专辑

Task< Result < nlohmann::json > > qqmusic::get_fav_album (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_fav_mv

获取收藏MV

Task< Result < nlohmann::json > > qqmusic::get_fav_mv (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_fav_num

获取歌曲的收藏量

Task< Result < nlohmann::json > > qqmusic::get_fav_num (
    std::span< uint64_t > id_list,
    bool readable=true
) 

Parameters:

  • id_list 歌曲id列表
  • readable 是否人类可读

示例:

readable == false 返回: {'438910555': 1000001}
readable == true 返回:  {'438910555': '550w+'}

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_fav_song

获取收藏歌曲

Task< Result < nlohmann::json > > qqmusic::get_fav_song (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_fav_songlist

获取收藏歌单

Task< Result < nlohmann::json > > qqmusic::get_fav_songlist (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_follow_singers

获取关注的歌手列表

Task< Result < nlohmann::json > > qqmusic::get_follow_singers (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_follow_usr

获取关注用户列表

Task< Result < nlohmann::json > > qqmusic::get_follow_usr (
    std::string_view euin,
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • encrypt_uin
  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_friend_list

获取好友列表

Task< Result < nlohmann::json > > qqmusic::get_friend_list (
    unsigned page=1,
    unsigned num=10,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • page 页码, 默认1
  • num 返回数量, 默认10
  • credential 凭据信息

function get_homepage

获取用户主页信息

Task< Result < nlohmann::json > > qqmusic::get_homepage (
    std::string_view euin,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • euin encrypt_uin
  • credential 凭据信息

Returns:

用户主页信息, 包含音乐基因, 歌单等


function get_labels

获取歌曲标签信息

Task< Result < nlohmann::json > > qqmusic::get_labels (
    uint64_t songid
) 

Parameters:

  • id 歌曲id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_lyric

获取歌曲的歌词

Task< Result < Lyric > > qqmusic::get_lyric (
    std::string_view mid,
    bool qrc=false,
    bool trans=false,
    bool roma=false
) 

Parameters:

  • mid 歌曲mid
  • qrc lyric是否是xml格式, 默认false
  • trans 是否附带翻译
  • roma 是否附带罗马音

Returns:

原始的歌词字符串, qrc歌词仅经过解码, 还是原始的xml格式

Note:

异步函数, 返回Task


function get_lyric

获取歌曲的歌词

Task< Result < Lyric > > qqmusic::get_lyric (
    uint64_t id,
    bool qrc=false,
    bool trans=false,
    bool roma=false
) 

Parameters:

  • id 歌曲id
  • qrc lyric是否是xml格式, 默认false
  • trans 是否附带翻译
  • roma 是否附带罗马音

Returns:

原始的歌词字符串, qrc歌词仅经过解码, 还是原始的xml格式

Note:

异步函数, 返回Task


function get_music_gene

获取音乐基因

Task< Result < nlohmann::json > > qqmusic::get_music_gene (
    std::string_view euin,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • euin encrypt_uin
  • credential 凭据信息

function get_musicid

由euin获取musicid

Task< Result < uint64_t > > qqmusic::get_musicid (
    std::string_view euin
) 

Parameters:

  • euin encrypt_uin

Returns:

musicid


function get_mv_detail

获取一组MV的信息

Task< Result < nlohmann::json > > qqmusic::get_mv_detail (
    std::span< std::string > vids
) 

Parameters:

  • vids 待查询的MV vid列表

Returns:

MV信息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 歌手mid
  • number 单次获取数据量, 默认10
  • begin 从第几个开始

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_mv_list_all

获取歌手所有MV

Task< Result < nlohmann::json > > qqmusic::get_mv_list_all (
    std::string_view mid
) 

Parameters:

  • mid 歌手mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_mv_urls

获取mv url

Task< Result < std::vector< MvUrl > > > qqmusic::get_mv_urls (
    std::span< std::string > vids
) 

Parameters:

  • vids 待查询的MV vid列表

Returns:

MvUrl列表

Note:

异步函数, 返回Task


function get_other_version

获取同名歌曲的其他版本

Task< Result < nlohmann::json > > qqmusic::get_other_version (
    std::string_view mid
) 

Parameters:

  • mid 歌曲mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_other_version

获取同名歌曲的其他版本

Task< Result < nlohmann::json > > qqmusic::get_other_version (
    uint64_t id
) 

Parameters:

  • id 歌曲id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_producer_info

获取歌曲制作者信息

Task< Result < nlohmann::json > > qqmusic::get_producer_info (
    std::string_view mid
) 

Parameters:

  • mid 歌曲mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

可能返回JSON的null, 即没有制作者信息

Note:

异步函数, 返回Task


function get_producer_info

获取歌曲制作者信息

Task< Result < nlohmann::json > > qqmusic::get_producer_info (
    uint64_t id
) 

Parameters:

  • id 歌曲id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

可能返回JSON的null, 即没有制作者信息

Note:

异步函数, 返回Task


function get_qrcode

获取登陆二维码

qqmusic::Task< qqmusic::Result< QRCode > > qqmusic::get_qrcode (
    QRLoginType login_type
) 

Parameters:

  • login_type 登陆类型

Returns:

包含正确结果的Task< Result < QRCode >>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


获取相关MV

Task< Result < nlohmann::json > > qqmusic::get_related_mv (
    uint64_t songid,
    std::optional< std::string > last_mvid=std::nullopt
) 

Parameters:

  • id 歌曲id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


获取相关歌单列表

Task< Result < nlohmann::json > > qqmusic::get_related_songlist (
    uint64_t songid
) 

Parameters:

  • id 歌曲id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_sheet

获取曲谱信息

Task< Result < nlohmann::json > > qqmusic::get_sheet (
    std::string_view mid
) 

Parameters:

  • mid 歌曲mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_similar_singers

获取相似歌手信息

Task< Result < nlohmann::json > > qqmusic::get_similar_singers (
    std::string_view mid,
    unsigned number=10
) 

Parameters:

  • mids 歌手mid
  • number 相似歌手数量, 默认为0

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

See also: TabType

Note:

异步函数, 返回Task


function get_similar_songs

获取相似歌曲列表

Task< Result < nlohmann::json > > qqmusic::get_similar_songs (
    uint64_t songid
) 

Parameters:

  • id 歌曲id

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_singer_info

获取歌手基本信息

Task< Result < nlohmann::json > > qqmusic::get_singer_info (
    std::string_view mid
) 

Parameters:

  • 歌手mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


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_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_song_detail

获取歌曲详细信息

Task< Result < nlohmann::json > > qqmusic::get_song_detail (
    std::string_view mid
) 

Parameters:

  • mid 歌曲mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_song_detail

获取歌曲详细信息

Task< Result < nlohmann::json > > qqmusic::get_song_detail (
    uint64_t id
) 

Parameters:

  • id 歌曲id

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_song_urls

批量获取歌曲播放链接

Task< Result < std::vector< SongInfo > > > qqmusic::get_song_urls (
    std::span< std::string > mids,
    std::unique_ptr< BaseMediaFileType > file_type=std::make_unique< SongFileType >(),
    std::optional< utils::Credential > credential=std::nullopt
) 

@params mids 歌曲mid列表 @params file_type 歌曲文件类型, 默认MP3_128类型 @params credential 凭证信息

调用示例:

std::vector<std::string> mids{"002n5zzy3VVGau"};

// 未加密类型
auto res = co_await get_song_urls(mids,
    std::make_unique<SongFileType>(SongFileType::ACC_192));

// 加密文件类型 
auto res = co_await get_song_urls(mids,
    std::make_unique<EncryptedSongFileType>(EncryptedSongFileType::MASTER));

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

See also: BaseMediaFileType, SongFileType, EncryptedSongFileType

Note:

异步函数, 返回Task


function get_songlist

获取歌单列表

Task< Result < nlohmann::json > > qqmusic::get_songlist (
    uint64_t dissid,
    unsigned dirid=0
) 

Parameters:

  • dissid 歌单ID
  • dirid 歌单dirid, 默认为0

Returns:

Json格式歌单列表

Note:

异步函数, 返回Task


function get_songlist_detail

获取歌单信息

Task< Result < nlohmann::json > > qqmusic::get_songlist_detail (
    uint64_t dissid,
    unsigned dirid=0,
    unsigned num=10,
    unsigned page=1,
    bool only_song=false,
    bool tag=true,
    bool user_info=true
) 

Parameters:

  • dissid 歌单ID
  • dirid 歌单drid, 默认为0
  • num 返回songlist元素数量, 默认为10
  • page 第几页, 默认为1
  • only_song 是否仅返回歌曲信息, 默认false
  • tag 是否返回歌单标签信息, 默认true
  • user_info 是否返回歌单创建者的用户信息, 默认true

Returns:

Json格式的歌单信息

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 歌手mid
  • num 每次获取的最大数量, 默认10, 最大30
  • begin 从第几个开始

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function get_songs_list_all

获取歌手的所有歌曲

Task< Result < nlohmann::json > > qqmusic::get_songs_list_all (
    std::string_view mid
) 

Parameters:

  • mid 歌手mid

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

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 歌手mid
  • type 标签信息
  • page 页码
  • num 每页返回数量

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

See also: TabType

Note:

异步函数, 返回Task


function get_toplist_category

获取所有排行榜

Task< Result < nlohmann::json > > qqmusic::get_toplist_category () 


function get_toplist_item_detail

获取排行榜条目信息

Task< Result < nlohmann::json > > qqmusic::get_toplist_item_detail (
    unsigned top_id,
    unsigned num=10,
    unsigned page=1,
    bool tag=true
) 

Parameters:

  • top_id 排行榜ID
  • num 返回数量, 默认为10
  • page 页码, 默认为0
  • tag 是否返回歌曲标签, 默认为true

Returns:


function get_try_url

获取试听链接

Task< Result < std::string > > qqmusic::get_try_url (
    std::string_view mid,
    std::string_view vs
) 

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_vip_info

获取当前账号vip信息

Task< Result < nlohmann::json > > qqmusic::get_vip_info (
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • credential 凭据信息

function hotkey

获取搜索热词

Task< Result < nlohmann::json > > qqmusic::hotkey () 

Returns:

Json格式的搜索热词

Note:

异步函数, 返回Task


function keyword_complete

搜索词联想补全

Task< Result < nlohmann::json > > qqmusic::keyword_complete (
    std::string_view keyword
) 

Parameters:

  • keyword 当前搜索词

Returns:

带有高亮的补全结果

Note:

异步函数, 返回Task


function phone_authorize

手机号认证

qqmusic::Task< qqmusic::Result< utils::Credential > > qqmusic::phone_authorize (
    std::string_view phone,
    std::string_view auth_code,
    std::string_view country_code="86"
) 

Parameters:

  • phone 手机号
  • auth_code 验证码
  • country_code 地区前缀

Returns:

qqmusic::Task<qqmusic::Result< qqmusic::utils::Credential >> 出错就会返回Err

Note:

异步函数, 返回Task

Warning:

该函数仍有问题, 不应使用


function query_song

批量查询歌曲信息

Task< Result < nlohmann::json > > qqmusic::query_song (
    std::span< std::string > mids
) 

Parameters:

  • mids 待查询歌曲mid列表

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


function query_song

批量查询歌曲信息

Task< Result < nlohmann::json > > qqmusic::query_song (
    std::span< uint64_t > ids
) 

Parameters:

  • mids 待查询歌曲id列表

Returns:

包含正确JSON格式结果的Task< Result <nlohmann::json>>. 如果产生错误, 返回值包含错误结果和错误类型枚举

Note:

异步函数, 返回Task


快速搜索

Task< Result < nlohmann::json > > qqmusic::quick_search (
    std::string_view keyword
) 

Parameters:

  • keyword 搜索词

Returns:

Json格式搜索结果

Note:

异步函数, 返回Task


function search_by_type

按类型搜索

Task< Result < nlohmann::json > > qqmusic::search_by_type (
    std::string_view keyword,
    SearchType type=SearchType::SONG,
    unsigned num_per_page=10,
    unsigned page=1,
    bool highlight=true
) 

Parameters:

  • keybord 搜索词
  • type 搜索类型
  • num_per_page 每页结果数
  • page 页数

Returns:

Json格式搜索结果

Note:

异步函数, 返回Task


function send_authcode

向指定手机号发送验证码

qqmusic::Task< qqmusic::Result< PhoneLoginResult > > qqmusic::send_authcode (
    std::string_view phone,
    std::string_view country_code="86"
) 

Parameters:

  • phone 手机号
  • country_code 地区前缀

Returns:

qqmusic::Task<qqmusic::Result< PhoneLoginResult >> 出错就会返回Err

Note:

异步函数, 返回Task

Warning:

该函数仍有问题, 不应使用


function songlist_add_songs

向歌单内添加歌曲

Task< Result < bool > > qqmusic::songlist_add_songs (
    uint64_t dirid,
    std::span< uint64_t > song_ids,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • dirid 歌单ID
  • song_ids 待添加歌单列表
  • credential 凭据信息

Returns:

是否添加成功, 歌曲已存在则返回false


function songlist_create

创建歌单

Task< Result < nlohmann::json > > qqmusic::songlist_create (
    std::string_view dirname,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • dirname 新的歌单名称
  • credential 凭据信息

Returns:

创建歌单的基本信息

Note:

异步函数, 返回Task

Warning:

歌单名称不应该含有除了正常字符之外的东西, 例如emoji, 这将导致歌单虽然被正确创建, 但是返回时json解析异常报错


function songlist_delete

删除歌单

Task< Result < bool > > qqmusic::songlist_delete (
    uint64_t dirid,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • dirid 歌单ID
  • credential 凭据信息

Returns:

是否删除成功, 如果不存在这个歌单则返回false


function songlist_delete_songs

删除歌单内指定歌曲

Task< Result < bool > > qqmusic::songlist_delete_songs (
    uint64_t dirid,
    std::span< uint64_t > song_ids,
    std::optional< utils::Credential > credential=std::nullopt
) 

Parameters:

  • dirid 歌单ID
  • song_ids 待删除歌单列表
  • credential 凭据信息

Returns:

是否删除成功, 歌曲不存在则返回false



The documentation for this class was generated from the following file src/album.cc