Skip to content

Commit

Permalink
feat: 添加歌词摘录相关接口
Browse files Browse the repository at this point in the history
  • Loading branch information
s12mmm3 committed Jan 12, 2025
1 parent 83e703f commit 526d101
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
53 changes: 52 additions & 1 deletion QCloudMusicApi/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@ QVariantMap Api::login_qr_key(QVariantMap query) {

// 二维码生成接口
QVariantMap Api::login_qr_create(QVariantMap query) {
const QString url = "http://music.163.com/login?codekey=" + query["key"].toString();
const QString url = "https://music.163.com/login?codekey=" + query["key"].toString();
auto result = QVariantMap{
{ "code", 200 },
{ "status", 200 },
Expand Down Expand Up @@ -3661,6 +3661,57 @@ QVariantMap Api::song_like_check(QVariantMap query) {
);
}

// 歌词摘录 - 添加/修改摘录歌词
QVariantMap Api::song_lyrics_mark_add(QVariantMap query) {
QVariantMap data{
{ "songId", query["id"] },
{ "markId", query.value("markId", "") },
{ "data", query.value("data", "[]") },
};
return request(
"/api/song/play/lyrics/mark/add",
data,
Option::createOption(query)
);
}

// 歌词摘录 - 删除摘录歌词
QVariantMap Api::song_lyrics_mark_del(QVariantMap query) {
QVariantMap data{
{ "markIds", query["id"] },
};
return request(
"/api/song/play/lyrics/mark/del",
data,
Option::createOption(query)
);
}

// 歌词摘录 - 我的歌词本
QVariantMap Api::song_lyrics_mark_user_page(QVariantMap query) {
QVariantMap data{
{ "limit", query.value("limit", "10") },
{ "offset", query.value("offset", "0") },
};
return request(
"/api/song/play/lyrics/mark/user/page",
data,
Option::createOption(query)
);
}

// 歌词摘录 - 歌词摘录信息
QVariantMap Api::song_lyrics_mark(QVariantMap query) {
QVariantMap data{
{ "songId", query["id"] },
};
return request(
"/api/song/play/lyrics/mark/song",
data,
Option::createOption(query)
);
}

// 会员本月下载歌曲记录
QVariantMap Api::song_monthdownlist(QVariantMap query) {
QVariantMap data{
Expand Down
12 changes: 12 additions & 0 deletions QCloudMusicApi/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,18 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi : public QObject {
// 歌曲是否喜爱
Q_INVOKABLE QVariantMap song_like_check(QVariantMap);

// 歌词摘录 - 添加/修改摘录歌词
Q_INVOKABLE QVariantMap song_lyrics_mark_add(QVariantMap);

// 歌词摘录 - 删除摘录歌词
Q_INVOKABLE QVariantMap song_lyrics_mark_del(QVariantMap);

// 歌词摘录 - 我的歌词本
Q_INVOKABLE QVariantMap song_lyrics_mark_user_page(QVariantMap);

// 歌词摘录 - 歌词摘录信息
Q_INVOKABLE QVariantMap song_lyrics_mark(QVariantMap);

// 会员本月下载歌曲记录
Q_INVOKABLE QVariantMap song_monthdownlist(QVariantMap);

Expand Down
3 changes: 3 additions & 0 deletions Test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,8 @@
},
"playlist_detail_rcmd_get": {
"id": "2057797340"
},
"song_lyrics_mark": {
"id": "2057797340"
}
}

0 comments on commit 526d101

Please sign in to comment.