From 6c92cd6afc85aa420e199e778555288c24eafe1d Mon Sep 17 00:00:00 2001 From: overwriter Date: Mon, 8 Jan 2024 07:43:20 +0800 Subject: [PATCH 1/8] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/util/config.h | 8 +++++--- QCloudMusicApi/util/crypto.h | 8 ++++---- QCloudMusicApi/util/index.h | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/QCloudMusicApi/util/config.h b/QCloudMusicApi/util/config.h index b4e6f98..ca59bc9 100644 --- a/QCloudMusicApi/util/config.h +++ b/QCloudMusicApi/util/config.h @@ -1,11 +1,13 @@ #ifndef CONFIG_H #define CONFIG_H + #include #include -namespace Config{ -static QString anonymous_token = "de91e1f8119d32e01cc73efcb82c0a30c9137e8d4f88dbf5e3d7bf3f28998f21add2bc8204eeee5e56c0bbb8743574b46ca2c10c35dc172199bef9bf4d60ecdeab066bb4dc737d1c3324751bcc9aaf44c3061cd18d77b7a0"; -static QVariantMap resourceTypeMap { +namespace Config { + +const static QString anonymous_token = QStringLiteral("de91e1f8119d32e01cc73efcb82c0a30c9137e8d4f88dbf5e3d7bf3f28998f21add2bc8204eeee5e56c0bbb8743574b46ca2c10c35dc172199bef9bf4d60ecdeab066bb4dc737d1c3324751bcc9aaf44c3061cd18d77b7a0"); +const static QVariantMap resourceTypeMap { { "0", "R_SO_4_" }, { "1", "R_MV_5_" }, { "2", "A_PL_0_" }, diff --git a/QCloudMusicApi/util/crypto.h b/QCloudMusicApi/util/crypto.h index 273782d..9127246 100644 --- a/QCloudMusicApi/util/crypto.h +++ b/QCloudMusicApi/util/crypto.h @@ -183,7 +183,7 @@ static QByteArray rsaEncrypt (QString plainText, const QString& strPubKey) return encryptData; } -static const QVariantMap weapi(QJsonDocument object) { +QVariantMap weapi(QJsonDocument object) { const QString text = object.toJson(QJsonDocument::Compact); // 创建一个长度为16的字节数组 @@ -211,14 +211,14 @@ static const QVariantMap weapi(QJsonDocument object) { }; } -static const QVariantMap linuxapi(QJsonDocument object) { +QVariantMap linuxapi(QJsonDocument object) { const QString text = object.toJson(QJsonDocument::Indented); return { { QStringLiteral("eparams"), aesEncrypt(text.toUtf8(), EVP_aes_128_ecb, linuxapiKey, QStringLiteral("")).toHex().toUpper() } }; } -static const QVariantMap eapi(QString url, QJsonDocument object) { +QVariantMap eapi(QString url, QJsonDocument object) { const QString text = object.toJson(QJsonDocument::Indented); const QString message = QStringLiteral("nobody") + url @@ -236,7 +236,7 @@ static const QVariantMap eapi(QString url, QJsonDocument object) { }; } -static const QByteArray decrypt(QByteArray cipherBuffer) { +QByteArray decrypt(QByteArray cipherBuffer) { return aesDecrypt(cipherBuffer, EVP_aes_128_ecb, eapiKey, ""); } } diff --git a/QCloudMusicApi/util/index.h b/QCloudMusicApi/util/index.h index 4ec589c..c4b1082 100644 --- a/QCloudMusicApi/util/index.h +++ b/QCloudMusicApi/util/index.h @@ -3,7 +3,8 @@ #include #include -namespace Index{ +namespace Index { + QVariantMap stringToMap(const QString &cookie) { if (cookie.isEmpty()) return QVariantMap(); QVariantMap map; From 383b22800f577e557631fc9f02cfe21ed220e224 Mon Sep 17 00:00:00 2001 From: overwriter Date: Wed, 10 Jan 2024 20:45:54 +0800 Subject: [PATCH 2/8] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/CMakeLists.txt | 10 ++++------ QCloudMusicApi/module.cpp | 3 ++- QCloudMusicApi/{request.hpp => request.cpp} | 11 ++++++----- QCloudMusicApi/request.h | 13 +++++++++++++ 4 files changed, 25 insertions(+), 12 deletions(-) rename QCloudMusicApi/{request.hpp => request.cpp} (98%) create mode 100644 QCloudMusicApi/request.h diff --git a/QCloudMusicApi/CMakeLists.txt b/QCloudMusicApi/CMakeLists.txt index dd73edc..e5fde02 100644 --- a/QCloudMusicApi/CMakeLists.txt +++ b/QCloudMusicApi/CMakeLists.txt @@ -12,13 +12,11 @@ find_package(OpenSSL REQUIRED) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network) +FILE(GLOB HEADERS ./*.h ./util/*.h) +FILE(GLOB SOURCES ./*.cpp ./util/*.cpp) add_library(QCloudMusicApi SHARED - ./util/crypto.h - ./util/config.h - ./util/index.h - module.h - module.cpp - request.hpp + ${HEADERS} + ${SOURCES} ) target_link_libraries(QCloudMusicApi Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network OpenSSL::SSL OpenSSL::Crypto) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index 581c5c7..9860fbb 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -9,8 +9,9 @@ #include #include #include +#include -#include "request.hpp" +#include "request.h" //入参与返回值类型为QVariantMap #define APICPP(FUNCNAME) \ diff --git a/QCloudMusicApi/request.hpp b/QCloudMusicApi/request.cpp similarity index 98% rename from QCloudMusicApi/request.hpp rename to QCloudMusicApi/request.cpp index 2ce5616..d862106 100644 --- a/QCloudMusicApi/request.hpp +++ b/QCloudMusicApi/request.cpp @@ -1,6 +1,4 @@ -#pragma once - -#include +#include #include #include #include @@ -26,7 +24,7 @@ namespace Request { -static QString chooseUserAgent(QString ua = "") { +QString chooseUserAgent(QString ua = "") { const QVariantMap userAgentList { { "mobile", @@ -66,7 +64,10 @@ static QString chooseUserAgent(QString ua = "") { : ua; } -static auto createRequest(QNetworkAccessManager::Operation method, QString urlStr, QVariantMap data, QVariantMap options) { +QVariantMap createRequest(QNetworkAccessManager::Operation method, + QString urlStr, + QVariantMap data, + QVariantMap options) { QUrl url(urlStr); qDebug().noquote() << QJsonDocument::fromVariant( diff --git a/QCloudMusicApi/request.h b/QCloudMusicApi/request.h new file mode 100644 index 0000000..054702b --- /dev/null +++ b/QCloudMusicApi/request.h @@ -0,0 +1,13 @@ +#include +#include + +namespace Request { + +QString chooseUserAgent(QString ua = ""); + +QVariantMap createRequest(QNetworkAccessManager::Operation method, + QString urlStr, + QVariantMap data, + QVariantMap options); + +} From e2973abbd1e75e937bd596a31919191bb5b42457 Mon Sep 17 00:00:00 2001 From: overwriter Date: Thu, 11 Jan 2024 07:58:59 +0800 Subject: [PATCH 3/8] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/module.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index 9860fbb..55d10bd 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -1,6 +1,4 @@ -#include "module.h" - -#include +#include #include #include #include @@ -12,6 +10,7 @@ #include #include "request.h" +#include "module.h" //入参与返回值类型为QVariantMap #define APICPP(FUNCNAME) \ From 781c33f6321c477458ba5e0bdbd7bc9c23281aa4 Mon Sep 17 00:00:00 2001 From: overwriter Date: Thu, 11 Jan 2024 23:20:23 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E4=BA=91=E8=B4=9D=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/module.cpp | 34 ++++++++++++++++++++++++++++++++++ QCloudMusicApi/module.h | 6 ++++++ 2 files changed, 40 insertions(+) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index 55d10bd..f001afd 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -2253,6 +2253,40 @@ APICPP(user_playlist) { ); } +// 云贝 todo 任务 +APICPP(yunbei_tasks_todo) { + const QVariantMap data {}; + // /api/point/today/get + return request( + POST, + "https://music.163.com/api/usertool/task/todo/query", + data, + { + { "crypto", "weapi" }, + { "cookie", query["cookie"] }, + { "proxy", query["proxy"] }, + { "realIP", query["realIP"] } + } + ); +} + +// 云贝所有任务 +APICPP(yunbei_tasks) { + const QVariantMap data {}; + // /api/point/today/get + return request( + POST, + "https://music.163.com/api/usertool/task/list/all", + data, + { + { "crypto", "weapi" }, + { "cookie", query["cookie"] }, + { "proxy", query["proxy"] }, + { "realIP", query["realIP"] } + } + ); +} + // 云贝今日签到信息 APICPP(yunbei_today) { const QVariantMap data {}; diff --git a/QCloudMusicApi/module.h b/QCloudMusicApi/module.h index 39c1396..2d05734 100644 --- a/QCloudMusicApi/module.h +++ b/QCloudMusicApi/module.h @@ -383,6 +383,12 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi: public QObject { // 用户歌单 APIH(user_playlist) + // 云贝 todo 任务 + APIH(yunbei_tasks_todo) + + // 云贝所有任务 + APIH(yunbei_tasks) + // 云贝今日签到信息 APIH(yunbei_today) From 32c65a665aafc7892f150e410dce62f5849d031c Mon Sep 17 00:00:00 2001 From: overwriter Date: Fri, 12 Jan 2024 19:19:37 +0800 Subject: [PATCH 5/8] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E4=BD=BF=E7=94=A8=E5=AE=8F=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E4=B8=80=E4=BA=9B=E9=87=8D=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/module.cpp | 438 ++++++++++---------------------------- 1 file changed, 115 insertions(+), 323 deletions(-) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index f001afd..28a834f 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -16,6 +16,12 @@ #define APICPP(FUNCNAME) \ const QVariantMap NeteaseCloudMusicApi::FUNCNAME(QVariantMap query) +//定义一些重复参数 +#define _PARAM \ +{ "cookie", query["cookie"] }, \ +{ "proxy", query["proxy"] }, \ +{ "realIP", query["realIP"] } \ + const static auto request = Request::createRequest; const static auto POST = QNetworkAccessManager::PostOperation; const static auto GET = QNetworkAccessManager::GetOperation; @@ -31,9 +37,7 @@ APICPP(activate_init_profile) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/activate/initProfile" } } ); @@ -50,9 +54,7 @@ APICPP(album_detail_dynamic) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -68,9 +70,7 @@ APICPP(album_detail) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -89,9 +89,7 @@ APICPP(album_list_style) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -111,9 +109,7 @@ APICPP(album_list) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -132,9 +128,7 @@ APICPP(album_new) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -147,9 +141,7 @@ APICPP(album_newest) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -167,9 +159,7 @@ APICPP(album_songsaleboard) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -186,9 +176,7 @@ APICPP(album_sub) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -206,9 +194,7 @@ APICPP(album_sublist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -221,9 +207,7 @@ APICPP(album) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -241,9 +225,7 @@ APICPP(artist_album) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -259,9 +241,7 @@ APICPP(artist_desc) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -277,9 +257,7 @@ APICPP(artist_detail) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -297,9 +275,7 @@ APICPP(artist_fans) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -315,9 +291,7 @@ APICPP(artist_follow_count) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -355,9 +329,7 @@ APICPP(artist_list) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -376,9 +348,7 @@ APICPP(artist_mv) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -399,9 +369,7 @@ APICPP(artist_new_mv) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -422,9 +390,7 @@ APICPP(artist_new_song) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -448,9 +414,7 @@ APICPP(artist_songs) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -470,9 +434,7 @@ APICPP(artist_sub) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -490,9 +452,7 @@ APICPP(artist_sublist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -508,9 +468,7 @@ APICPP(artist_top_song) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -532,9 +490,7 @@ APICPP(artist_video) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -547,9 +503,7 @@ APICPP(artists) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -593,10 +547,8 @@ APICPP(cloudsearch) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "url", "/api/cloudsearch/pc" }, - { "realIP", query["realIP"] } + _PARAM, + { "url", "/api/cloudsearch/pc" } } ); } @@ -618,9 +570,7 @@ APICPP(comment_album) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -642,9 +592,7 @@ APICPP(comment_dj) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -662,9 +610,7 @@ APICPP(comment_event) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -686,9 +632,7 @@ APICPP(comment_music) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -710,9 +654,7 @@ APICPP(comment_mv) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -734,9 +676,7 @@ APICPP(comment_playlist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -758,9 +698,7 @@ APICPP(comment_video) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -774,10 +712,8 @@ APICPP(countries_code_list) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "url", "/api/lbs/countries/v1" }, - { "realIP", query["realIP"] } + _PARAM, + { "url", "/api/lbs/countries/v1" } } ); } @@ -791,9 +727,7 @@ APICPP(creator_authinfo_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/user/creator/authinfo/get" } } ); @@ -817,9 +751,7 @@ APICPP(daily_signin) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -835,9 +767,7 @@ APICPP(digitalAlbum_detail) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -860,9 +790,7 @@ APICPP(digitalAlbum_ordering) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -880,9 +808,7 @@ APICPP(digitalAlbum_purchased) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -898,9 +824,7 @@ APICPP(digitalAlbum_sales) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -917,9 +841,7 @@ APICPP(dj_banner) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -933,9 +855,7 @@ APICPP(dj_category_excludehot) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -949,9 +869,7 @@ APICPP(dj_category_recommend) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -965,9 +883,7 @@ APICPP(dj_catelist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -983,9 +899,7 @@ APICPP(dj_detail) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1002,9 +916,7 @@ APICPP(dj_hot) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1021,9 +933,7 @@ APICPP(dj_paygift) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1039,9 +949,7 @@ APICPP(dj_personalize_recommend) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1057,9 +965,7 @@ APICPP(dj_program_detail) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1076,9 +982,7 @@ APICPP(dj_program_toplist_hours) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1095,9 +999,7 @@ APICPP(dj_program_toplist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1116,9 +1018,7 @@ APICPP(dj_program) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1136,9 +1036,7 @@ APICPP(dj_radio_hot) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1177,9 +1075,7 @@ APICPP(dj_recommend_type) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1192,9 +1088,7 @@ APICPP(dj_recommend) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1211,9 +1105,7 @@ APICPP(dj_sub) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1231,9 +1123,7 @@ APICPP(dj_sublist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1252,9 +1142,7 @@ APICPP(dj_subscriber) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1270,9 +1158,7 @@ APICPP(dj_today_perfered) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1289,9 +1175,7 @@ APICPP(dj_toplist_hours) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1308,9 +1192,7 @@ APICPP(dj_toplist_newcomer) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1327,9 +1209,7 @@ APICPP(dj_toplist_pay) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1346,9 +1226,7 @@ APICPP(dj_toplist_popular) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1370,9 +1248,7 @@ APICPP(dj_toplist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1388,9 +1264,7 @@ APICPP(event_del) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1411,9 +1285,7 @@ APICPP(event_forward) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1430,9 +1302,7 @@ APICPP(event) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1451,9 +1321,7 @@ APICPP(fm_trash) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1473,9 +1341,7 @@ APICPP(follow) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1489,9 +1355,7 @@ APICPP(fanscenter_basicinfo_age_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/fanscenter/basicinfo/age/get" } } ); @@ -1506,9 +1370,7 @@ APICPP(fanscenter_basicinfo_gender_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/fanscenter/basicinfo/gender/get" } } ); @@ -1523,9 +1385,7 @@ APICPP(fanscenter_basicinfo_province_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/fanscenter/basicinfo/province/get" } } ); @@ -1540,9 +1400,7 @@ APICPP(fanscenter_overview_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/fanscenter/overview/get" } } ); @@ -1561,9 +1419,7 @@ APICPP(fanscenter_trend_list) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/fanscenter/trend/list" } } ); @@ -1592,9 +1448,7 @@ APICPP(login_cellphone) { { { "crypto", "weapi" }, { "ua", "pc" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); if(result["body"].toMap()["code"].toInt() == 200) { @@ -1621,9 +1475,7 @@ APICPP(login_qr_check) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); auto body = result["body"].toMap(); @@ -1647,9 +1499,7 @@ APICPP(login_qr_key) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); result = QVariantMap { @@ -1688,9 +1538,7 @@ APICPP(login_refresh) { { { "crypto", "weapi" }, { "ua", "pc" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); if(result["body"].toMap()["code"].toInt() == 200) { @@ -1713,9 +1561,7 @@ APICPP(login_status) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); if(result["body"].toMap()["code"].toInt() == 200) { @@ -1741,9 +1587,7 @@ APICPP(logout) { { { "crypto", "eapi" }, { "ua", "pc" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1767,9 +1611,7 @@ APICPP(lyric_new) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/song/lyric/v1" } } ); @@ -1794,9 +1636,7 @@ APICPP(lyric) { data, { { "crypto", "api" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1812,9 +1652,7 @@ APICPP(nickname_check) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1858,9 +1696,7 @@ APICPP(register_anonimous) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); if(result["body"].toMap()["code"].toInt() == 200) { @@ -1883,9 +1719,7 @@ APICPP(related_playlist) { {}, { { "ua", "pc" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); QRegularExpression pattern("
[\\s\\S]*?[\\s\\S]*?]*>([^<]+?)<\\/a>[\\s\\S]*?]*>([^<]+?)<\\/a>"); @@ -1939,9 +1773,7 @@ APICPP(search) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1957,9 +1789,7 @@ APICPP(search) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -1976,9 +1806,7 @@ APICPP(song_download_url) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/song/enhance/download/url" } } ); @@ -2002,9 +1830,7 @@ APICPP(song_url_v1) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/song/enhance/player/url/v1" } } ); @@ -2021,9 +1847,7 @@ APICPP(song_wiki_summary) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/song/play/about/block/page" } } ); @@ -2039,9 +1863,7 @@ APICPP(summary_annual) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/activity/summary/annual/" + query["year"].toString() + "/" + key } } ); @@ -2056,9 +1878,7 @@ APICPP(threshold_detail_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/influencer/web/apply/threshold/detail/get" } } ); @@ -2072,9 +1892,7 @@ APICPP(toplist) { {}, { { "crypto", "api" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2090,9 +1908,7 @@ APICPP(ugc_album_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/rep/ugc/album/get" } } ); @@ -2109,9 +1925,7 @@ APICPP(ugc_artist_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/rep/ugc/artist/get" } } ); @@ -2130,9 +1944,7 @@ APICPP(ugc_artist_search) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2148,9 +1960,7 @@ APICPP(ugc_mv_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/rep/ugc/mv/get" } } ); @@ -2167,9 +1977,7 @@ APICPP(ugc_song_get) { data, { { "crypto", "eapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] }, + _PARAM, { "url", "/api/rep/ugc/song/get" } } ); @@ -2184,9 +1992,7 @@ APICPP(user_account) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2210,9 +2016,7 @@ APICPP(user_comment_history) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2225,9 +2029,7 @@ APICPP(user_detail) { {}, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2246,9 +2048,7 @@ APICPP(user_playlist) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2263,9 +2063,7 @@ APICPP(yunbei_tasks_todo) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2280,9 +2078,7 @@ APICPP(yunbei_tasks) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2297,9 +2093,7 @@ APICPP(yunbei_today) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } @@ -2314,9 +2108,7 @@ APICPP(yunbei) { data, { { "crypto", "weapi" }, - { "cookie", query["cookie"] }, - { "proxy", query["proxy"] }, - { "realIP", query["realIP"] } + _PARAM } ); } From 6834a08f09cf49fa85111ca85611c8a44e167b5c Mon Sep 17 00:00:00 2001 From: overwriter Date: Fri, 12 Jan 2024 19:52:31 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0batch=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/module.cpp | 22 ++++++++++++++++++++++ QCloudMusicApi/module.h | 3 +++ Test/config.json | 3 +++ 3 files changed, 28 insertions(+) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index 28a834f..439b2d8 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -508,6 +508,28 @@ APICPP(artists) { ); } +// 批量请求接口 +APICPP(batch) { + QVariantMap data { + { "e_r", true } + }; + for(auto i = query.begin(); i != query.end(); i++) { + if(i.key().indexOf("/api/") == 0) { + data[i.key()] = i.value(); + } + } + return request( + POST, + "https://music.163.com/eapi/batch", + data, + { + { "crypto", "eapi" }, + _PARAM, + { "url", "/api/batch" } + } + ); +} + // 首页轮播图 APICPP(banner) { const auto type0 = query.value("type", 0).toInt(); diff --git a/QCloudMusicApi/module.h b/QCloudMusicApi/module.h index 2d05734..5b33ec1 100644 --- a/QCloudMusicApi/module.h +++ b/QCloudMusicApi/module.h @@ -116,6 +116,9 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi: public QObject { // 歌手单曲 APIH(artists) + // 批量请求接口 + APIH(batch) + // 首页轮播图 APIH(banner) diff --git a/Test/config.json b/Test/config.json index 7e79379..7258371 100644 --- a/Test/config.json +++ b/Test/config.json @@ -205,5 +205,8 @@ "follow": { "id": "79248480", "t": 1 + }, + "batch": { + "/api/v2/banner/get": "{\"clientType\":\"pc\"}" } } \ No newline at end of file From 5c645575eca5e164cf9790ea6be5341ca12dd796 Mon Sep 17 00:00:00 2001 From: overwriter Date: Fri, 12 Jan 2024 20:21:58 +0800 Subject: [PATCH 7/8] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/module.cpp | 70 +++++++++++++++++++++++++++++++++++++++ QCloudMusicApi/module.h | 12 +++++++ 2 files changed, 82 insertions(+) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index 439b2d8..0a89f4f 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -554,6 +554,76 @@ APICPP(banner) { ); } +// 音乐日历 +APICPP(calendar) { + const QVariantMap data { + { "startTime", query.value("startTime", QDateTime::currentDateTime().toMSecsSinceEpoch()) }, + { "endTime", query.value("endTime", QDateTime::currentDateTime().toMSecsSinceEpoch()) } + }; + return request( + POST, + "https://music.163.com/api/mcalendar/detail", + data, + { + { "crypto", "weapi" }, + _PARAM + } + ); +} + +// 发送验证码 +APICPP(captcha_sent) { + const QVariantMap data { + { "ctcode", query.value("ctcode", "86") }, + { "cellphone", query["cellphone"] } + }; + return request( + POST, + "https://music.163.com/api/sms/captcha/sent", + data, + { + { "crypto", "weapi" }, + _PARAM + } + ); +} + +// 校验验证码 +APICPP(captcha_verify) { + const QVariantMap data { + { "ctcode", query.value("ctcode", "86") }, + { "cellphone", query["phone"] }, + { "captcha", query["captcha"] } + }; + return request( + POST, + "https://music.163.com/weapi/sms/captcha/verify", + data, + { + { "crypto", "weapi" }, + _PARAM + } + ); +} + +// 检测手机号码是否已注册 +APICPP(cellphone_existence_check) { + const QVariantMap data { + { "cellphone", query["phone"] }, + { "countrycode", query["countrycode"] } + }; + return request( + POST, + "https://music.163.com/eapi/cellphone/existence/check", + data, + { + { "crypto", "eapi" }, + _PARAM, + { "url", "/api/cellphone/existence/check" } + } + ); +} + // 搜索 APICPP(cloudsearch) { const QVariantMap data { diff --git a/QCloudMusicApi/module.h b/QCloudMusicApi/module.h index 5b33ec1..3f98ef8 100644 --- a/QCloudMusicApi/module.h +++ b/QCloudMusicApi/module.h @@ -122,6 +122,18 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi: public QObject { // 首页轮播图 APIH(banner) + // 音乐日历 + APIH(calendar) + + // 发送验证码 + APIH(captcha_sent) + + // 校验验证码 + APIH(captcha_verify) + + // 检测手机号码是否已注册 + APIH(cellphone_existence_check) + // 搜索 APIH(cloudsearch) From 9c04fbe7fcd0523e01f65efa6eb37e639758d315 Mon Sep 17 00:00:00 2001 From: overwriter Date: Sat, 13 Jan 2024 07:53:42 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QCloudMusicApi/module.cpp | 39 ++++++++++++++++++++++++++++++++++++++ QCloudMusicApi/module.h | 3 +++ QCloudMusicApi/request.cpp | 4 ++-- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/QCloudMusicApi/module.cpp b/QCloudMusicApi/module.cpp index 0a89f4f..e256531 100644 --- a/QCloudMusicApi/module.cpp +++ b/QCloudMusicApi/module.cpp @@ -624,6 +624,45 @@ APICPP(cellphone_existence_check) { ); } +// 歌曲可用性 +APICPP(check_music) { + const QVariantMap data { + { "ids", QStringList { query["id"].toString() } }, + { "br", query.value("br", 999000) } + }; + QVariantMap result = request( + POST, + "https://music.163.com/weapi/song/enhance/player/url", + data, + { + { "crypto", "weapi" }, + _PARAM + } + ); + auto playable = false; + if(result["body"].toMap()["code"].toInt() == 200) { + if(result["body"].toMap()["data"].toList()[0].toMap()["code"].toInt() == 200) { + playable = true; + } + } + if(playable) { + result["body"] = QVariantMap { + { "code", 200 }, + { "success", true }, + { "message", "ok" } + }; + return result; + } + else { + result["body"] = QVariantMap { + { "code", 200 }, + { "success", false }, + { "message", "亲爱的,暂无版权" } + }; + return result; + } +} + // 搜索 APICPP(cloudsearch) { const QVariantMap data { diff --git a/QCloudMusicApi/module.h b/QCloudMusicApi/module.h index 3f98ef8..a6268e5 100644 --- a/QCloudMusicApi/module.h +++ b/QCloudMusicApi/module.h @@ -134,6 +134,9 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi: public QObject { // 检测手机号码是否已注册 APIH(cellphone_existence_check) + // 歌曲可用性 + APIH(check_music) + // 搜索 APIH(cloudsearch) diff --git a/QCloudMusicApi/request.cpp b/QCloudMusicApi/request.cpp index d862106..9b39adb 100644 --- a/QCloudMusicApi/request.cpp +++ b/QCloudMusicApi/request.cpp @@ -27,7 +27,7 @@ namespace Request { QString chooseUserAgent(QString ua = "") { const QVariantMap userAgentList { { - "mobile", + QStringLiteral("mobile"), QStringList { // iOS 13.5.1 14.0 beta with safari QStringLiteral(R"(Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1)"), @@ -44,7 +44,7 @@ QString chooseUserAgent(QString ua = "") { } }, { - "pc", + QStringLiteral("pc"), QStringList { // macOS 10.15.6 Firefox / Chrome / Safari QStringLiteral(R"(Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0)"),