@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.
Files changed (94) hide show
  1. package/.babelrc +2 -2
  2. package/.dockerignore +5 -5
  3. package/.editorconfig +31 -31
  4. package/.eslintrc.json +21 -17
  5. package/.github/FUNDING.yml +12 -12
  6. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -38
  7. package/.github/ISSUE_TEMPLATE/custom.md +24 -24
  8. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -20
  9. package/.github/workflows/publish.yml +26 -0
  10. package/.husky/commit-msg +1 -0
  11. package/.husky/pre-commit +1 -0
  12. package/.prettierignore +1 -1
  13. package/.prettierrc +9 -9
  14. package/CHANGELOG.md +70 -70
  15. package/Dockerfile +18 -18
  16. package/LICENSE +21 -21
  17. package/README.md +218 -177
  18. package/app.js +75 -75
  19. package/commitlint.config.js +20 -20
  20. package/config/user-info.js +42 -42
  21. package/index.js +1 -1
  22. package/middlewares/koa-cors.js +97 -97
  23. package/module/apis/UCommon/UCommon.js +6 -6
  24. package/module/apis/album/getAlbumInfo.js +33 -33
  25. package/module/apis/comments/getComments.js +35 -35
  26. package/module/apis/digitalAlbum/getDigitalAlbumLists.js +34 -34
  27. package/module/apis/downloadQQMusic.js +41 -41
  28. package/module/apis/music/getLyric.js +42 -41
  29. package/module/apis/mv/getMvByTag.js +35 -35
  30. package/module/apis/radio/getRadioLists.js +38 -38
  31. package/module/apis/rank/getTopLists.js +44 -44
  32. package/module/apis/search/getHotKey.js +35 -35
  33. package/module/apis/search/getSearchByKey.js +45 -45
  34. package/module/apis/search/getSmartbox.js +34 -34
  35. package/module/apis/singers/getSimilarSinger.js +36 -36
  36. package/module/apis/singers/getSingerDesc.js +38 -38
  37. package/module/apis/singers/getSingerMv.js +35 -35
  38. package/module/apis/singers/getSingerStarNum.js +36 -36
  39. package/module/apis/songLists/songListCategories.js +33 -33
  40. package/module/apis/songLists/songListDetail.js +38 -38
  41. package/module/apis/songLists/songLists.js +41 -41
  42. package/module/apis/u_common.js +17 -16
  43. package/module/apis/user/checkQQLoginQr.js +125 -86
  44. package/module/apis/user/getQQLoginQr.js +17 -11
  45. package/module/apis/y_common.js +27 -14
  46. package/module/config.js +31 -31
  47. package/module/index.js +82 -82
  48. package/package.json +72 -83
  49. package/public/index.html +47 -47
  50. package/routers/context/batchGetSongInfo.js +59 -59
  51. package/routers/context/batchGetSongLists.js +50 -50
  52. package/routers/context/checkQQLoginQr.js +17 -15
  53. package/routers/context/cookies.js +36 -36
  54. package/routers/context/getAlbumInfo.js +27 -27
  55. package/routers/context/getComments.js +51 -51
  56. package/routers/context/getDigitalAlbumLists.js +14 -14
  57. package/routers/context/getDownloadQQMusic.js +14 -14
  58. package/routers/context/getHotkey.js +14 -14
  59. package/routers/context/getImageUrl.js +34 -34
  60. package/routers/context/getLyric.js +26 -26
  61. package/routers/context/getMusicPlay.js +116 -112
  62. package/routers/context/getMv.js +56 -56
  63. package/routers/context/getMvByTag.js +15 -15
  64. package/routers/context/getMvPlay.js +128 -118
  65. package/routers/context/getNewDisks.js +50 -51
  66. package/routers/context/getQQLoginQr.js +12 -12
  67. package/routers/context/getRadioLists.js +14 -14
  68. package/routers/context/getRanks.js +90 -86
  69. package/routers/context/getRecommend.js +86 -86
  70. package/routers/context/getSearchByKey.js +32 -32
  71. package/routers/context/getSimilarSinger.js +25 -25
  72. package/routers/context/getSingerAlbum.js +52 -52
  73. package/routers/context/getSingerDesc.js +25 -25
  74. package/routers/context/getSingerHotsong.js +52 -52
  75. package/routers/context/getSingerList.js +51 -52
  76. package/routers/context/getSingerMv.js +32 -32
  77. package/routers/context/getSingerStarNum.js +24 -24
  78. package/routers/context/getSmartbox.js +24 -24
  79. package/routers/context/getSongInfo.js +49 -49
  80. package/routers/context/getSongListCategories.js +22 -22
  81. package/routers/context/getSongListDetail.js +25 -25
  82. package/routers/context/getSongLists.js +32 -32
  83. package/routers/context/getTicketInfo.js +45 -45
  84. package/routers/context/getTopLists.js +15 -15
  85. package/routers/context/index.js +74 -74
  86. package/routers/router.js +116 -112
  87. package/scripts/build-images.js +36 -36
  88. package/scripts/commit-push.sh +103 -103
  89. package/util/colors.js +16 -16
  90. package/util/cookie.js +22 -22
  91. package/util/loginUtils.js +28 -23
  92. package/util/lyricParse.js +64 -64
  93. package/util/request.js +57 -57
  94. package/vercel.json +15 -15
@@ -1,52 +1,52 @@
1
- const { UCommon } = require('../../module');
2
-
3
- // singermid=0025NhlN2yWrP4
4
- module.exports = async (ctx, next) => {
5
- const singermid = ctx.query.singermid;
6
- const num = +ctx.query.limit || 5;
7
- const begin = +ctx.query.page || 0;
8
- const data = {
9
- comm: {
10
- ct: 24,
11
- cv: 0,
12
- },
13
- singer: {
14
- method: 'GetAlbumList',
15
- param: {
16
- sort: 5,
17
- singermid,
18
- begin,
19
- num,
20
- },
21
- module: 'music.musichallAlbum.AlbumListServer',
22
- },
23
- };
24
- const params = Object.assign({
25
- format: 'json',
26
- singermid,
27
- data: JSON.stringify(data),
28
- });
29
- const props = {
30
- method: 'get',
31
- params,
32
- option: {},
33
- };
34
- if (singermid) {
35
- await UCommon(props)
36
- .then(res => {
37
- const response = res.data;
38
- ctx.status = 200;
39
- ctx.body = {
40
- response,
41
- };
42
- })
43
- .catch(error => {
44
- console.log('error', error);
45
- });
46
- } else {
47
- ctx.status = 400;
48
- ctx.body = {
49
- response: 'no singermid',
50
- };
51
- }
52
- };
1
+ const { UCommon } = require('../../module');
2
+
3
+ // singermid=0025NhlN2yWrP4
4
+ module.exports = async (ctx, next) => {
5
+ const singermid = ctx.query.singermid;
6
+ const num = +ctx.query.limit || 5;
7
+ const begin = +ctx.query.page || 0;
8
+ const data = {
9
+ comm: {
10
+ ct: 24,
11
+ cv: 0,
12
+ },
13
+ singer: {
14
+ method: 'GetAlbumList',
15
+ param: {
16
+ sort: 5,
17
+ singermid,
18
+ begin,
19
+ num,
20
+ },
21
+ module: 'music.musichallAlbum.AlbumListServer',
22
+ },
23
+ };
24
+ const params = Object.assign({
25
+ format: 'json',
26
+ singermid,
27
+ data: JSON.stringify(data),
28
+ });
29
+ const props = {
30
+ method: 'get',
31
+ params,
32
+ option: {},
33
+ };
34
+ if (singermid) {
35
+ await UCommon(props)
36
+ .then(res => {
37
+ const response = res.data;
38
+ ctx.status = 200;
39
+ ctx.body = {
40
+ response,
41
+ };
42
+ })
43
+ .catch(error => {
44
+ console.log('error', error);
45
+ });
46
+ } else {
47
+ ctx.status = 400;
48
+ ctx.body = {
49
+ response: 'no singermid',
50
+ };
51
+ }
52
+ };
@@ -1,25 +1,25 @@
1
- const { getSingerDesc } = require('../../module');
2
-
3
- module.exports = async (ctx, next) => {
4
- const { singermid } = ctx.query;
5
- const props = {
6
- method: 'get',
7
- params: {
8
- singermid,
9
- },
10
- option: {},
11
- };
12
- if (singermid) {
13
- const { status, body } = await getSingerDesc(props);
14
- Object.assign(ctx, {
15
- status,
16
- body,
17
- });
18
- } else {
19
- ctx.status = 400;
20
- ctx.body = {
21
- status: 400,
22
- response: 'no singermid',
23
- };
24
- }
25
- };
1
+ const { getSingerDesc } = require('../../module');
2
+
3
+ module.exports = async (ctx, next) => {
4
+ const { singermid } = ctx.query;
5
+ const props = {
6
+ method: 'get',
7
+ params: {
8
+ singermid,
9
+ },
10
+ option: {},
11
+ };
12
+ if (singermid) {
13
+ const { status, body } = await getSingerDesc(props);
14
+ Object.assign(ctx, {
15
+ status,
16
+ body,
17
+ });
18
+ } else {
19
+ ctx.status = 400;
20
+ ctx.body = {
21
+ status: 400,
22
+ response: 'no singermid',
23
+ };
24
+ }
25
+ };
@@ -1,52 +1,52 @@
1
- const { UCommon } = require('../../module');
2
-
3
- // singermid=0025NhlN2yWrP4
4
- module.exports = async (ctx, next) => {
5
- const singermid = ctx.query.singermid;
6
- const num = +ctx.query.limit || 5;
7
- const page = +ctx.query.page || 0;
8
- const data = {
9
- comm: {
10
- ct: 24,
11
- cv: 0,
12
- },
13
- singer: {
14
- method: 'get_singer_detail_info',
15
- param: {
16
- sort: 5,
17
- singermid,
18
- sin: (page - 1) * num,
19
- num,
20
- },
21
- module: 'music.web_singer_info_svr',
22
- },
23
- };
24
- const params = Object.assign({
25
- format: 'json',
26
- singermid,
27
- data: JSON.stringify(data),
28
- });
29
- const props = {
30
- method: 'get',
31
- params,
32
- option: {},
33
- };
34
- if (singermid) {
35
- await UCommon(props)
36
- .then(res => {
37
- const response = res.data;
38
- ctx.status = 200;
39
- ctx.body = {
40
- response,
41
- };
42
- })
43
- .catch(error => {
44
- console.log('error', error);
45
- });
46
- } else {
47
- ctx.status = 400;
48
- ctx.body = {
49
- response: 'no singermid',
50
- };
51
- }
52
- };
1
+ const { UCommon } = require('../../module');
2
+
3
+ // singermid=0025NhlN2yWrP4
4
+ module.exports = async (ctx, next) => {
5
+ const singermid = ctx.query.singermid;
6
+ const num = +ctx.query.limit || 5;
7
+ const page = +ctx.query.page || 0;
8
+ const data = {
9
+ comm: {
10
+ ct: 24,
11
+ cv: 0,
12
+ },
13
+ singer: {
14
+ method: 'get_singer_detail_info',
15
+ param: {
16
+ sort: 5,
17
+ singermid,
18
+ sin: (page - 1) * num,
19
+ num,
20
+ },
21
+ module: 'music.web_singer_info_svr',
22
+ },
23
+ };
24
+ const params = Object.assign({
25
+ format: 'json',
26
+ singermid,
27
+ data: JSON.stringify(data),
28
+ });
29
+ const props = {
30
+ method: 'get',
31
+ params,
32
+ option: {},
33
+ };
34
+ if (singermid) {
35
+ await UCommon(props)
36
+ .then(res => {
37
+ const response = res.data;
38
+ ctx.status = 200;
39
+ ctx.body = {
40
+ response,
41
+ };
42
+ })
43
+ .catch(error => {
44
+ console.log('error', error);
45
+ });
46
+ } else {
47
+ ctx.status = 400;
48
+ ctx.body = {
49
+ response: 'no singermid',
50
+ };
51
+ }
52
+ };
@@ -1,52 +1,51 @@
1
- const { UCommon } = require('../../module');
2
- const { _guid, commonParams } = require('../../module/config');
3
-
4
- // -100 默认值 all
5
- // area [1 - 6]
6
- // sex 0 男 1 女 2 组合
7
- // genre [1 - 20]
8
- // index a-z # 1-27
9
- module.exports = async (ctx, next) => {
10
- const { area = -100, sex = -100, genre = -100, index = -100, page = 1 } = ctx.query;
11
- const guid = _guid ? _guid + '' : '1429839143';
12
- const data = {
13
- comm: {
14
- ct: 24,
15
- cv: 0,
16
- },
17
- singerList: {
18
- module: 'Music.SingerListServer',
19
- method: 'get_singer_list',
20
- param: {
21
- area: +area,
22
- sex: +sex,
23
- genre: +genre,
24
- index: +index,
25
- sin: (page - 1) * 80,
26
- cur_page: +page,
27
- },
28
- },
29
- };
30
- const params = Object.assign(commonParams, {
31
- format: 'json',
32
- data: JSON.stringify(data),
33
- });
34
- const props = {
35
- method: 'get',
36
- params,
37
- option: {},
38
- };
39
- await UCommon(props)
40
- .then(res => {
41
- console.log(res);
42
- const response = res.data;
43
- ctx.status = 200;
44
- ctx.body = {
45
- status: 200,
46
- response,
47
- };
48
- })
49
- .catch(error => {
50
- console.log('error', error);
51
- });
52
- };
1
+ const { UCommon } = require('../../module');
2
+ const { commonParams } = require('../../module/config');
3
+
4
+ // -100 默认值 all
5
+ // area [1 - 6]
6
+ // sex 0 男 1 女 2 组合
7
+ // genre [1 - 20]
8
+ // index a-z # 1-27
9
+ module.exports = async (ctx, next) => {
10
+ const { area = -100, sex = -100, genre = -100, index = -100, page = 1 } = ctx.query;
11
+ const data = {
12
+ comm: {
13
+ ct: 24,
14
+ cv: 0,
15
+ },
16
+ singerList: {
17
+ module: 'Music.SingerListServer',
18
+ method: 'get_singer_list',
19
+ param: {
20
+ area: +area,
21
+ sex: +sex,
22
+ genre: +genre,
23
+ index: +index,
24
+ sin: (page - 1) * 80,
25
+ cur_page: +page,
26
+ },
27
+ },
28
+ };
29
+ const params = Object.assign(commonParams, {
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
+ console.log(res);
41
+ const response = res.data;
42
+ ctx.status = 200;
43
+ ctx.body = {
44
+ status: 200,
45
+ response,
46
+ };
47
+ })
48
+ .catch(error => {
49
+ console.log('error', error);
50
+ });
51
+ };
@@ -1,32 +1,32 @@
1
- const { getSingerMv } = require('../../module');
2
-
3
- module.exports = async (ctx, next) => {
4
- const { singermid, order, num = 5 } = ctx.query;
5
- const params = Object.assign({
6
- singermid,
7
- order,
8
- num,
9
- });
10
- if (order && order.toLowerCase() === 'time') {
11
- params = Object.assign(params, {
12
- cmd: 1,
13
- });
14
- }
15
- const props = {
16
- method: 'get',
17
- params,
18
- option: {},
19
- };
20
- if (singermid) {
21
- const { status, body } = await getSingerMv(props);
22
- Object.assign(ctx, {
23
- status,
24
- body,
25
- });
26
- } else {
27
- ctx.status = 400;
28
- ctx.body = {
29
- response: 'no singermid',
30
- };
31
- }
32
- };
1
+ const { getSingerMv } = require('../../module');
2
+
3
+ module.exports = async (ctx, next) => {
4
+ const { singermid, order, num = 5 } = ctx.query;
5
+ let params = Object.assign({
6
+ singermid,
7
+ order,
8
+ num,
9
+ });
10
+ if (order && order.toLowerCase() === 'time') {
11
+ params = Object.assign(params, {
12
+ cmd: 1,
13
+ });
14
+ }
15
+ const props = {
16
+ method: 'get',
17
+ params,
18
+ option: {},
19
+ };
20
+ if (singermid) {
21
+ const { status, body } = await getSingerMv(props);
22
+ Object.assign(ctx, {
23
+ status,
24
+ body,
25
+ });
26
+ } else {
27
+ ctx.status = 400;
28
+ ctx.body = {
29
+ response: 'no singermid',
30
+ };
31
+ }
32
+ };
@@ -1,24 +1,24 @@
1
- const { getSingerStarNum } = require('../../module');
2
-
3
- module.exports = async (ctx, next) => {
4
- const { singermid } = ctx.query;
5
- const props = {
6
- method: 'get',
7
- params: {
8
- singermid,
9
- },
10
- option: {},
11
- };
12
- if (singermid) {
13
- const { status, body } = await getSingerStarNum(props);
14
- Object.assign(ctx, {
15
- status,
16
- body,
17
- });
18
- } else {
19
- ctx.status = 400;
20
- ctx.body = {
21
- response: 'no singermid',
22
- };
23
- }
24
- };
1
+ const { getSingerStarNum } = require('../../module');
2
+
3
+ module.exports = async (ctx, next) => {
4
+ const { singermid } = ctx.query;
5
+ const props = {
6
+ method: 'get',
7
+ params: {
8
+ singermid,
9
+ },
10
+ option: {},
11
+ };
12
+ if (singermid) {
13
+ const { status, body } = await getSingerStarNum(props);
14
+ Object.assign(ctx, {
15
+ status,
16
+ body,
17
+ });
18
+ } else {
19
+ ctx.status = 400;
20
+ ctx.body = {
21
+ response: 'no singermid',
22
+ };
23
+ }
24
+ };
@@ -1,24 +1,24 @@
1
- const { getSmartbox } = require('../../module');
2
-
3
- module.exports = async (ctx, next) => {
4
- const { key } = ctx.query;
5
- const props = {
6
- method: 'get',
7
- params: {
8
- key,
9
- },
10
- option: {},
11
- };
12
- if (key) {
13
- const { status, body } = await getSmartbox(props);
14
- Object.assign(ctx, {
15
- status,
16
- body,
17
- });
18
- } else {
19
- ctx.status = 200;
20
- ctx.body = {
21
- response: null,
22
- };
23
- }
24
- };
1
+ const { getSmartbox } = require('../../module');
2
+
3
+ module.exports = async (ctx, next) => {
4
+ const { key } = ctx.query;
5
+ const props = {
6
+ method: 'get',
7
+ params: {
8
+ key,
9
+ },
10
+ option: {},
11
+ };
12
+ if (key) {
13
+ const { status, body } = await getSmartbox(props);
14
+ Object.assign(ctx, {
15
+ status,
16
+ body,
17
+ });
18
+ } else {
19
+ ctx.status = 200;
20
+ ctx.body = {
21
+ response: null,
22
+ };
23
+ }
24
+ };
@@ -1,49 +1,49 @@
1
- const { UCommon } = require('../../module');
2
- const { commonParams } = require('../../module/config');
3
-
4
- // songmid=001CLC7W2Gpz4J
5
- module.exports = async (ctx, next) => {
6
- const song_mid = ctx.query.songmid;
7
- const song_id = ctx.query.songid || '';
8
-
9
- const params = Object.assign(commonParams, {
10
- format: 'json',
11
- inCharset: 'utf8',
12
- outCharset: 'utf-8',
13
- notice: 0,
14
- platform: 'yqq.json',
15
- needNewCode: 0,
16
- data: {
17
- comm: {
18
- ct: 24,
19
- cv: 0,
20
- },
21
- songinfo: {
22
- method: 'get_song_detail_yqq',
23
- param: {
24
- song_type: 0,
25
- song_mid,
26
- song_id,
27
- },
28
- module: 'music.pf_song_detail_svr',
29
- },
30
- },
31
- });
32
- const props = {
33
- method: 'get',
34
- params,
35
- option: {},
36
- };
37
-
38
- await UCommon(props)
39
- .then(res => {
40
- const response = res.data;
41
- ctx.status = 200;
42
- ctx.body = {
43
- response,
44
- };
45
- })
46
- .catch(error => {
47
- console.log('error', error);
48
- });
49
- };
1
+ const { UCommon } = require('../../module');
2
+ const { commonParams } = require('../../module/config');
3
+
4
+ // songmid=001CLC7W2Gpz4J
5
+ module.exports = async (ctx, next) => {
6
+ const song_mid = ctx.query.songmid;
7
+ const song_id = ctx.query.songid || '';
8
+
9
+ const params = Object.assign(commonParams, {
10
+ format: 'json',
11
+ inCharset: 'utf8',
12
+ outCharset: 'utf-8',
13
+ notice: 0,
14
+ platform: 'yqq.json',
15
+ needNewCode: 0,
16
+ data: {
17
+ comm: {
18
+ ct: 24,
19
+ cv: 0,
20
+ },
21
+ songinfo: {
22
+ method: 'get_song_detail_yqq',
23
+ param: {
24
+ song_type: 0,
25
+ song_mid,
26
+ song_id,
27
+ },
28
+ module: 'music.pf_song_detail_svr',
29
+ },
30
+ },
31
+ });
32
+ const props = {
33
+ method: 'get',
34
+ params,
35
+ option: {},
36
+ };
37
+
38
+ await UCommon(props)
39
+ .then(res => {
40
+ const response = res.data;
41
+ ctx.status = 200;
42
+ ctx.body = {
43
+ response,
44
+ };
45
+ })
46
+ .catch(error => {
47
+ console.log('error', error);
48
+ });
49
+ };
@@ -1,22 +1,22 @@
1
- const { songListCategories } = require('../../module');
2
-
3
- /**
4
- * @description: 歌单
5
- * 1 歌单类型
6
- * 2 所有歌单
7
- * 3 分类歌单
8
- * 4 歌单详情
9
- *
10
- */
11
- module.exports = async (ctx, next) => {
12
- const props = {
13
- method: 'get',
14
- params: {},
15
- option: {},
16
- };
17
- const { status, body } = await songListCategories(props);
18
- Object.assign(ctx, {
19
- status,
20
- body,
21
- });
22
- };
1
+ const { songListCategories } = require('../../module');
2
+
3
+ /**
4
+ * @description: 歌单
5
+ * 1 歌单类型
6
+ * 2 所有歌单
7
+ * 3 分类歌单
8
+ * 4 歌单详情
9
+ *
10
+ */
11
+ module.exports = async (ctx, next) => {
12
+ const props = {
13
+ method: 'get',
14
+ params: {},
15
+ option: {},
16
+ };
17
+ const { status, body } = await songListCategories(props);
18
+ Object.assign(ctx, {
19
+ status,
20
+ body,
21
+ });
22
+ };