Skip to content

Commit 630ba9a

Browse files
committed
feat:增加部分接口
1 parent 8e3e8cc commit 630ba9a

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

QCloudMusicApi/module.cpp

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,68 @@ QVariantMap Api::history_recommend_songs(QVariantMap query) {
18051805
);
18061806
}
18071807

1808+
// 首页-发现 block page
1809+
// 这个接口为移动端接口,首页-发现页,数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L259 HomeBlockPageWrap
1810+
// query.refresh 是否刷新数据
1811+
QVariantMap Api::homepage_block_page(QVariantMap query) {
1812+
QVariantMap cookie = query["cookie"].toMap();
1813+
cookie["os"] = "ios";
1814+
cookie["appver"] = "8.10.90";
1815+
query["cookie"] = cookie;
1816+
const QVariantMap data {
1817+
{ "refresh", query.value("refresh", false) },
1818+
{ "cursor", query["cursor"] }
1819+
};
1820+
return request(
1821+
POST,
1822+
"https://music.163.com/api/homepage/block/page",
1823+
data,
1824+
{
1825+
{ "crypto", "weapi" },
1826+
_PARAM
1827+
}
1828+
);
1829+
}
1830+
1831+
// 首页-发现 dragon ball
1832+
// 这个接口为移动端接口,首页-发现页(每日推荐、歌单、排行榜 那些入口)
1833+
// 数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L290 HomeDragonBallWrap
1834+
// !需要登录或者游客登录,非登录返回 []
1835+
QVariantMap Api::homepage_dragon_ball(QVariantMap query) {
1836+
QVariantMap cookie = query["cookie"].toMap();
1837+
cookie["os"] = "ios";
1838+
cookie["appver"] = "8.10.90";
1839+
query["cookie"] = cookie;
1840+
const QVariantMap data { };
1841+
return request(
1842+
POST,
1843+
"https://music.163.com/eapi/homepage/dragon/ball/static",
1844+
data,
1845+
{
1846+
{ "crypto", "eapi" },
1847+
_PARAM,
1848+
{ "url", "/api/homepage/dragon/ball/static"}
1849+
}
1850+
);
1851+
}
1852+
1853+
//热门话题
1854+
QVariantMap Api::hot_topic(QVariantMap query) {
1855+
const QVariantMap data {
1856+
{ "limit", query.value("limit", 20) },
1857+
{ "offset", query.value("offset", 0) }
1858+
};
1859+
return request(
1860+
POST,
1861+
"https://music.163.com/api/act/hot",
1862+
data,
1863+
{
1864+
{ "crypto", "weapi" },
1865+
_PARAM
1866+
}
1867+
);
1868+
}
1869+
18081870
// 手机登录
18091871
QVariantMap Api::login_cellphone(QVariantMap query) {
18101872
QVariantMap cookie = query["cookie"].toMap();

QCloudMusicApi/module.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,20 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi: public QObject {
339339
// 历史每日推荐歌曲
340340
Q_INVOKABLE QVariantMap history_recommend_songs(QVariantMap);
341341

342+
// 首页-发现 block page
343+
// 这个接口为移动端接口,首页-发现页,数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L259 HomeBlockPageWrap
344+
// query.refresh 是否刷新数据
345+
Q_INVOKABLE QVariantMap homepage_block_page(QVariantMap);
346+
347+
// 首页-发现 dragon ball
348+
// 这个接口为移动端接口,首页-发现页(每日推荐、歌单、排行榜 那些入口)
349+
// 数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L290 HomeDragonBallWrap
350+
// !需要登录或者游客登录,非登录返回 []
351+
Q_INVOKABLE QVariantMap homepage_dragon_ball(QVariantMap);
352+
353+
//热门话题
354+
Q_INVOKABLE QVariantMap hot_topic(QVariantMap);
355+
342356
// 手机登录
343357
Q_INVOKABLE QVariantMap login_cellphone(QVariantMap);
344358

0 commit comments

Comments
 (0)