@sansenjian/qq-music-api 1.0.6 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -2
- package/.dockerignore +5 -5
- package/.editorconfig +31 -31
- package/.eslintrc.json +21 -17
- package/.github/FUNDING.yml +12 -12
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -38
- package/.github/ISSUE_TEMPLATE/custom.md +24 -24
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -20
- package/.github/workflows/publish.yml +26 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.prettierignore +1 -1
- package/.prettierrc +9 -9
- package/CHANGELOG.md +70 -70
- package/Dockerfile +18 -18
- package/LICENSE +21 -21
- package/README.md +218 -177
- package/app.js +75 -75
- package/commitlint.config.js +20 -20
- package/config/user-info.js +42 -42
- package/index.js +1 -1
- package/middlewares/koa-cors.js +97 -97
- package/module/apis/UCommon/UCommon.js +6 -6
- package/module/apis/album/getAlbumInfo.js +33 -33
- package/module/apis/comments/getComments.js +35 -35
- package/module/apis/digitalAlbum/getDigitalAlbumLists.js +34 -34
- package/module/apis/downloadQQMusic.js +41 -41
- package/module/apis/music/getLyric.js +42 -41
- package/module/apis/mv/getMvByTag.js +35 -35
- package/module/apis/radio/getRadioLists.js +38 -38
- package/module/apis/rank/getTopLists.js +44 -44
- package/module/apis/search/getHotKey.js +35 -35
- package/module/apis/search/getSearchByKey.js +45 -45
- package/module/apis/search/getSmartbox.js +34 -34
- package/module/apis/singers/getSimilarSinger.js +36 -36
- package/module/apis/singers/getSingerDesc.js +38 -38
- package/module/apis/singers/getSingerMv.js +35 -35
- package/module/apis/singers/getSingerStarNum.js +36 -36
- package/module/apis/songLists/songListCategories.js +33 -33
- package/module/apis/songLists/songListDetail.js +38 -38
- package/module/apis/songLists/songLists.js +41 -41
- package/module/apis/u_common.js +17 -16
- package/module/apis/user/checkQQLoginQr.js +125 -86
- package/module/apis/user/getQQLoginQr.js +17 -11
- package/module/apis/y_common.js +27 -14
- package/module/config.js +31 -31
- package/module/index.js +82 -82
- package/package.json +72 -83
- package/public/index.html +47 -47
- package/routers/context/batchGetSongInfo.js +59 -59
- package/routers/context/batchGetSongLists.js +50 -50
- package/routers/context/checkQQLoginQr.js +17 -15
- package/routers/context/cookies.js +36 -36
- package/routers/context/getAlbumInfo.js +27 -27
- package/routers/context/getComments.js +51 -51
- package/routers/context/getDigitalAlbumLists.js +14 -14
- package/routers/context/getDownloadQQMusic.js +14 -14
- package/routers/context/getHotkey.js +14 -14
- package/routers/context/getImageUrl.js +34 -34
- package/routers/context/getLyric.js +26 -26
- package/routers/context/getMusicPlay.js +116 -112
- package/routers/context/getMv.js +56 -56
- package/routers/context/getMvByTag.js +15 -15
- package/routers/context/getMvPlay.js +128 -118
- package/routers/context/getNewDisks.js +50 -51
- package/routers/context/getQQLoginQr.js +12 -12
- package/routers/context/getRadioLists.js +14 -14
- package/routers/context/getRanks.js +90 -86
- package/routers/context/getRecommend.js +86 -86
- package/routers/context/getSearchByKey.js +32 -32
- package/routers/context/getSimilarSinger.js +25 -25
- package/routers/context/getSingerAlbum.js +52 -52
- package/routers/context/getSingerDesc.js +25 -25
- package/routers/context/getSingerHotsong.js +52 -52
- package/routers/context/getSingerList.js +51 -52
- package/routers/context/getSingerMv.js +32 -32
- package/routers/context/getSingerStarNum.js +24 -24
- package/routers/context/getSmartbox.js +24 -24
- package/routers/context/getSongInfo.js +49 -49
- package/routers/context/getSongListCategories.js +22 -22
- package/routers/context/getSongListDetail.js +25 -25
- package/routers/context/getSongLists.js +32 -32
- package/routers/context/getTicketInfo.js +45 -45
- package/routers/context/getTopLists.js +15 -15
- package/routers/context/index.js +74 -74
- package/routers/router.js +116 -112
- package/scripts/build-images.js +36 -36
- package/scripts/commit-push.sh +103 -103
- package/util/colors.js +16 -16
- package/util/cookie.js +22 -22
- package/util/loginUtils.js +28 -23
- package/util/lyricParse.js +64 -64
- package/util/request.js +57 -57
- package/vercel.json +15 -15
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
const { UCommon } = require('../../module');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
ctx.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
1
|
+
const { UCommon } = require('../../module');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx, next) => {
|
|
4
|
+
const page = +ctx.query.page || 1;
|
|
5
|
+
const num = +ctx.query.limit || 20;
|
|
6
|
+
const start = (page - 1) * num;
|
|
7
|
+
const data = {
|
|
8
|
+
new_album: {
|
|
9
|
+
module: 'newalbum.NewAlbumServer',
|
|
10
|
+
method: 'get_new_album_info',
|
|
11
|
+
param: {
|
|
12
|
+
area: 1,
|
|
13
|
+
start,
|
|
14
|
+
num,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
comm: {
|
|
18
|
+
ct: 24,
|
|
19
|
+
cv: 0,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
if (!start) {
|
|
23
|
+
data.new_album_tag = {
|
|
24
|
+
module: 'newalbum.NewAlbumServer',
|
|
25
|
+
method: 'get_new_album_area',
|
|
26
|
+
param: {},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const params = Object.assign({
|
|
30
|
+
format: 'json',
|
|
31
|
+
data: JSON.stringify(data),
|
|
32
|
+
});
|
|
33
|
+
const props = {
|
|
34
|
+
method: 'get',
|
|
35
|
+
params,
|
|
36
|
+
option: {},
|
|
37
|
+
};
|
|
38
|
+
await UCommon(props)
|
|
39
|
+
.then(res => {
|
|
40
|
+
const response = res.data;
|
|
41
|
+
ctx.status = 200;
|
|
42
|
+
ctx.body = {
|
|
43
|
+
status: 200,
|
|
44
|
+
response,
|
|
45
|
+
};
|
|
46
|
+
})
|
|
47
|
+
.catch(error => {
|
|
48
|
+
console.log('error', error);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const { getQQLoginQr } = require('../../module');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx, next) => {
|
|
4
|
-
const props = {
|
|
5
|
-
method: 'get',
|
|
6
|
-
};
|
|
7
|
-
const { status, body } = await getQQLoginQr(props);
|
|
8
|
-
Object.assign(ctx, {
|
|
9
|
-
status,
|
|
10
|
-
body,
|
|
11
|
-
});
|
|
12
|
-
};
|
|
1
|
+
const { getQQLoginQr } = require('../../module');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx, next) => {
|
|
4
|
+
const props = {
|
|
5
|
+
method: 'get',
|
|
6
|
+
};
|
|
7
|
+
const { status, body } = await getQQLoginQr(props);
|
|
8
|
+
Object.assign(ctx, {
|
|
9
|
+
status,
|
|
10
|
+
body,
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const { getRadioLists } = require('../../module');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx, next) => {
|
|
4
|
-
const props = {
|
|
5
|
-
method: 'get',
|
|
6
|
-
params: {},
|
|
7
|
-
option: {},
|
|
8
|
-
};
|
|
9
|
-
const { status, body } = await getRadioLists(props);
|
|
10
|
-
Object.assign(ctx, {
|
|
11
|
-
status,
|
|
12
|
-
body,
|
|
13
|
-
});
|
|
14
|
-
};
|
|
1
|
+
const { getRadioLists } = require('../../module');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx, next) => {
|
|
4
|
+
const props = {
|
|
5
|
+
method: 'get',
|
|
6
|
+
params: {},
|
|
7
|
+
option: {},
|
|
8
|
+
};
|
|
9
|
+
const { status, body } = await getRadioLists(props);
|
|
10
|
+
Object.assign(ctx, {
|
|
11
|
+
status,
|
|
12
|
+
body,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -1,86 +1,90 @@
|
|
|
1
|
-
const { UCommon } = require('../../module');
|
|
2
|
-
const { commonParams } = require('../../module/config');
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
1
|
+
const { UCommon } = require('../../module');
|
|
2
|
+
const { commonParams } = require('../../module/config');
|
|
3
|
+
const dayjs = require('dayjs');
|
|
4
|
+
const isoWeek = require('dayjs/plugin/isoWeek');
|
|
5
|
+
const isoWeekYear = require('dayjs/plugin/isoWeekYear');
|
|
6
|
+
dayjs.extend(isoWeek);
|
|
7
|
+
dayjs.extend(isoWeekYear);
|
|
8
|
+
|
|
9
|
+
module.exports = async (ctx, next) => {
|
|
10
|
+
// Desc: https://github.com/Rain120/qq-music-api/issues/14
|
|
11
|
+
// 1. topId is useless
|
|
12
|
+
// 2. qq api period is change not YYYY-MM-DD
|
|
13
|
+
const topId = +ctx.query.topId || 4;
|
|
14
|
+
const num = +ctx.query.limit || 20;
|
|
15
|
+
const offset = +ctx.query.page || 0;
|
|
16
|
+
const date = ctx.query.period || dayjs();
|
|
17
|
+
const week = dayjs(date).isoWeek();
|
|
18
|
+
const isoWeekYearVal = dayjs(date).isoWeekYear();
|
|
19
|
+
const period = `${isoWeekYearVal}_${week}`;
|
|
20
|
+
|
|
21
|
+
const data = {
|
|
22
|
+
comm: {
|
|
23
|
+
...(commonParams || {}),
|
|
24
|
+
cv: 4747474,
|
|
25
|
+
ct: 24,
|
|
26
|
+
format: 'json',
|
|
27
|
+
inCharset: 'utf-8',
|
|
28
|
+
needNewCode: 1,
|
|
29
|
+
uin: 0,
|
|
30
|
+
},
|
|
31
|
+
req_1: {
|
|
32
|
+
module: 'musicToplist.ToplistInfoServer',
|
|
33
|
+
method: 'GetDetail',
|
|
34
|
+
param: {
|
|
35
|
+
topId,
|
|
36
|
+
offset,
|
|
37
|
+
num,
|
|
38
|
+
period,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
// TODO: 新评论,之后迭代更新再说
|
|
42
|
+
// req_2: {
|
|
43
|
+
// module: 'music.globalComment.CommentReadServer',
|
|
44
|
+
// method: 'GetNewCommentList',
|
|
45
|
+
// param: {
|
|
46
|
+
// BizType: 4,
|
|
47
|
+
// BizId: '59',
|
|
48
|
+
// LastCommentSeqNo: '',
|
|
49
|
+
// PageSize: 25,
|
|
50
|
+
// PageNum: 0,
|
|
51
|
+
// FromCommentId: '',
|
|
52
|
+
// WithHot: 1,
|
|
53
|
+
// },
|
|
54
|
+
// },
|
|
55
|
+
// TODO: 热门评论,之后迭代更新再说
|
|
56
|
+
// req_3: {
|
|
57
|
+
// module: 'music.globalComment.CommentReadServer',
|
|
58
|
+
// method: 'GetHotCommentList',
|
|
59
|
+
// param: {
|
|
60
|
+
// BizType: 4,
|
|
61
|
+
// BizId: '59',
|
|
62
|
+
// LastCommentSeqNo: '',
|
|
63
|
+
// PageSize: 15,
|
|
64
|
+
// PageNum: 0,
|
|
65
|
+
// HotType: 2,
|
|
66
|
+
// WithAirborne: 1,
|
|
67
|
+
// },
|
|
68
|
+
// },
|
|
69
|
+
};
|
|
70
|
+
const params = Object.assign({
|
|
71
|
+
format: 'json',
|
|
72
|
+
data: JSON.stringify(data),
|
|
73
|
+
});
|
|
74
|
+
const props = {
|
|
75
|
+
method: 'get',
|
|
76
|
+
params,
|
|
77
|
+
option: {},
|
|
78
|
+
};
|
|
79
|
+
await UCommon(props)
|
|
80
|
+
.then(res => {
|
|
81
|
+
const response = res.data;
|
|
82
|
+
ctx.status = 200;
|
|
83
|
+
ctx.body = {
|
|
84
|
+
response,
|
|
85
|
+
};
|
|
86
|
+
})
|
|
87
|
+
.catch(error => {
|
|
88
|
+
console.log('error', error);
|
|
89
|
+
});
|
|
90
|
+
};
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
const { UCommon } = require('../../module');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx, next) => {
|
|
4
|
-
const data = {
|
|
5
|
-
comm: {
|
|
6
|
-
ct: 24,
|
|
7
|
-
},
|
|
8
|
-
category: {
|
|
9
|
-
method: 'get_hot_category',
|
|
10
|
-
param: {
|
|
11
|
-
qq: '',
|
|
12
|
-
},
|
|
13
|
-
module: 'music.web_category_svr',
|
|
14
|
-
},
|
|
15
|
-
recomPlaylist: {
|
|
16
|
-
method: 'get_hot_recommend',
|
|
17
|
-
param: {
|
|
18
|
-
async: 1,
|
|
19
|
-
cmd: 2,
|
|
20
|
-
},
|
|
21
|
-
module: 'playlist.HotRecommendServer',
|
|
22
|
-
},
|
|
23
|
-
playlist: {
|
|
24
|
-
method: 'get_playlist_by_category',
|
|
25
|
-
param: {
|
|
26
|
-
id: 8,
|
|
27
|
-
curPage: 1,
|
|
28
|
-
size: 40,
|
|
29
|
-
order: 5,
|
|
30
|
-
titleid: 8,
|
|
31
|
-
},
|
|
32
|
-
module: 'playlist.PlayListPlazaServer',
|
|
33
|
-
},
|
|
34
|
-
new_song: {
|
|
35
|
-
module: 'newsong.NewSongServer',
|
|
36
|
-
method: 'get_new_song_info',
|
|
37
|
-
param: {
|
|
38
|
-
type: 5,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
new_album: {
|
|
42
|
-
module: 'newalbum.NewAlbumServer',
|
|
43
|
-
method: 'get_new_album_info',
|
|
44
|
-
param: {
|
|
45
|
-
area: 1,
|
|
46
|
-
sin: 0,
|
|
47
|
-
num: 10,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
new_album_tag: {
|
|
51
|
-
module: 'newalbum.NewAlbumServer',
|
|
52
|
-
method: 'get_new_album_area',
|
|
53
|
-
param: {},
|
|
54
|
-
},
|
|
55
|
-
toplist: {
|
|
56
|
-
module: 'musicToplist.ToplistInfoServer',
|
|
57
|
-
method: 'GetAll',
|
|
58
|
-
param: {},
|
|
59
|
-
},
|
|
60
|
-
focus: {
|
|
61
|
-
module: 'QQMusic.MusichallServer',
|
|
62
|
-
method: 'GetFocus',
|
|
63
|
-
param: {},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
const params = Object.assign({
|
|
67
|
-
format: 'json',
|
|
68
|
-
data: JSON.stringify(data),
|
|
69
|
-
});
|
|
70
|
-
const props = {
|
|
71
|
-
method: 'get',
|
|
72
|
-
params,
|
|
73
|
-
option: {},
|
|
74
|
-
};
|
|
75
|
-
await UCommon(props)
|
|
76
|
-
.then(res => {
|
|
77
|
-
const response = res.data;
|
|
78
|
-
ctx.status = 200;
|
|
79
|
-
ctx.body = {
|
|
80
|
-
response,
|
|
81
|
-
};
|
|
82
|
-
})
|
|
83
|
-
.catch(error => {
|
|
84
|
-
console.log('error', error);
|
|
85
|
-
});
|
|
86
|
-
};
|
|
1
|
+
const { UCommon } = require('../../module');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx, next) => {
|
|
4
|
+
const data = {
|
|
5
|
+
comm: {
|
|
6
|
+
ct: 24,
|
|
7
|
+
},
|
|
8
|
+
category: {
|
|
9
|
+
method: 'get_hot_category',
|
|
10
|
+
param: {
|
|
11
|
+
qq: '',
|
|
12
|
+
},
|
|
13
|
+
module: 'music.web_category_svr',
|
|
14
|
+
},
|
|
15
|
+
recomPlaylist: {
|
|
16
|
+
method: 'get_hot_recommend',
|
|
17
|
+
param: {
|
|
18
|
+
async: 1,
|
|
19
|
+
cmd: 2,
|
|
20
|
+
},
|
|
21
|
+
module: 'playlist.HotRecommendServer',
|
|
22
|
+
},
|
|
23
|
+
playlist: {
|
|
24
|
+
method: 'get_playlist_by_category',
|
|
25
|
+
param: {
|
|
26
|
+
id: 8,
|
|
27
|
+
curPage: 1,
|
|
28
|
+
size: 40,
|
|
29
|
+
order: 5,
|
|
30
|
+
titleid: 8,
|
|
31
|
+
},
|
|
32
|
+
module: 'playlist.PlayListPlazaServer',
|
|
33
|
+
},
|
|
34
|
+
new_song: {
|
|
35
|
+
module: 'newsong.NewSongServer',
|
|
36
|
+
method: 'get_new_song_info',
|
|
37
|
+
param: {
|
|
38
|
+
type: 5,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
new_album: {
|
|
42
|
+
module: 'newalbum.NewAlbumServer',
|
|
43
|
+
method: 'get_new_album_info',
|
|
44
|
+
param: {
|
|
45
|
+
area: 1,
|
|
46
|
+
sin: 0,
|
|
47
|
+
num: 10,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
new_album_tag: {
|
|
51
|
+
module: 'newalbum.NewAlbumServer',
|
|
52
|
+
method: 'get_new_album_area',
|
|
53
|
+
param: {},
|
|
54
|
+
},
|
|
55
|
+
toplist: {
|
|
56
|
+
module: 'musicToplist.ToplistInfoServer',
|
|
57
|
+
method: 'GetAll',
|
|
58
|
+
param: {},
|
|
59
|
+
},
|
|
60
|
+
focus: {
|
|
61
|
+
module: 'QQMusic.MusichallServer',
|
|
62
|
+
method: 'GetFocus',
|
|
63
|
+
param: {},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const params = Object.assign({
|
|
67
|
+
format: 'json',
|
|
68
|
+
data: JSON.stringify(data),
|
|
69
|
+
});
|
|
70
|
+
const props = {
|
|
71
|
+
method: 'get',
|
|
72
|
+
params,
|
|
73
|
+
option: {},
|
|
74
|
+
};
|
|
75
|
+
await UCommon(props)
|
|
76
|
+
.then(res => {
|
|
77
|
+
const response = res.data;
|
|
78
|
+
ctx.status = 200;
|
|
79
|
+
ctx.body = {
|
|
80
|
+
response,
|
|
81
|
+
};
|
|
82
|
+
})
|
|
83
|
+
.catch(error => {
|
|
84
|
+
console.log('error', error);
|
|
85
|
+
});
|
|
86
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
const { getSearchByKey } = require('../../module');
|
|
2
|
-
|
|
3
|
-
// w:搜索关键字
|
|
4
|
-
// p:当前页
|
|
5
|
-
// n:每页歌曲数量
|
|
6
|
-
// catZhida: 0表示歌曲, 2表示歌手, 3表示专辑, 4, 5
|
|
7
|
-
module.exports = async (ctx, next) => {
|
|
8
|
-
const { key: w, limit: n, page: p, catZhida, remoteplace = 'song' } = ctx.query;
|
|
9
|
-
const props = {
|
|
10
|
-
method: 'get',
|
|
11
|
-
params: {
|
|
12
|
-
w,
|
|
13
|
-
n: +n || 10,
|
|
14
|
-
p: +p || 1,
|
|
15
|
-
catZhida: +catZhida || 1,
|
|
16
|
-
remoteplace: `txt.yqq.${remoteplace}`,
|
|
17
|
-
},
|
|
18
|
-
option: {},
|
|
19
|
-
};
|
|
20
|
-
if (w) {
|
|
21
|
-
const { status, body } = await getSearchByKey(props);
|
|
22
|
-
Object.assign(ctx, {
|
|
23
|
-
status,
|
|
24
|
-
body,
|
|
25
|
-
});
|
|
26
|
-
} else {
|
|
27
|
-
ctx.status = 400;
|
|
28
|
-
ctx.body = {
|
|
29
|
-
response: 'search key is null',
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
1
|
+
const { getSearchByKey } = require('../../module');
|
|
2
|
+
|
|
3
|
+
// w:搜索关键字
|
|
4
|
+
// p:当前页
|
|
5
|
+
// n:每页歌曲数量
|
|
6
|
+
// catZhida: 0表示歌曲, 2表示歌手, 3表示专辑, 4, 5
|
|
7
|
+
module.exports = async (ctx, next) => {
|
|
8
|
+
const { key: w, limit: n, page: p, catZhida, remoteplace = 'song' } = ctx.query;
|
|
9
|
+
const props = {
|
|
10
|
+
method: 'get',
|
|
11
|
+
params: {
|
|
12
|
+
w,
|
|
13
|
+
n: +n || 10,
|
|
14
|
+
p: +p || 1,
|
|
15
|
+
catZhida: +catZhida || 1,
|
|
16
|
+
remoteplace: `txt.yqq.${remoteplace}`,
|
|
17
|
+
},
|
|
18
|
+
option: {},
|
|
19
|
+
};
|
|
20
|
+
if (w) {
|
|
21
|
+
const { status, body } = await getSearchByKey(props);
|
|
22
|
+
Object.assign(ctx, {
|
|
23
|
+
status,
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
ctx.status = 400;
|
|
28
|
+
ctx.body = {
|
|
29
|
+
response: 'search key is null',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
const { getSimilarSinger } = require('../../module');
|
|
2
|
-
|
|
3
|
-
// singermid=0025NhlN2yWrP4
|
|
4
|
-
module.exports = async (ctx, next) => {
|
|
5
|
-
const { singermid: singer_mid } = ctx.query;
|
|
6
|
-
const props = {
|
|
7
|
-
method: 'get',
|
|
8
|
-
params: {
|
|
9
|
-
singer_mid,
|
|
10
|
-
},
|
|
11
|
-
option: {},
|
|
12
|
-
};
|
|
13
|
-
if (singer_mid) {
|
|
14
|
-
const { status, body } = await getSimilarSinger(props);
|
|
15
|
-
Object.assign(ctx, {
|
|
16
|
-
status,
|
|
17
|
-
body,
|
|
18
|
-
});
|
|
19
|
-
} else {
|
|
20
|
-
ctx.status = 400;
|
|
21
|
-
ctx.body = {
|
|
22
|
-
response: 'no singermid',
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
};
|
|
1
|
+
const { getSimilarSinger } = require('../../module');
|
|
2
|
+
|
|
3
|
+
// singermid=0025NhlN2yWrP4
|
|
4
|
+
module.exports = async (ctx, next) => {
|
|
5
|
+
const { singermid: singer_mid } = ctx.query;
|
|
6
|
+
const props = {
|
|
7
|
+
method: 'get',
|
|
8
|
+
params: {
|
|
9
|
+
singer_mid,
|
|
10
|
+
},
|
|
11
|
+
option: {},
|
|
12
|
+
};
|
|
13
|
+
if (singer_mid) {
|
|
14
|
+
const { status, body } = await getSimilarSinger(props);
|
|
15
|
+
Object.assign(ctx, {
|
|
16
|
+
status,
|
|
17
|
+
body,
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
ctx.status = 400;
|
|
21
|
+
ctx.body = {
|
|
22
|
+
response: 'no singermid',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|