@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,35 +1,35 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'GB2312',
7
- cmd: 'shoubo',
8
- lan: 'all',
9
- });
10
- const options = Object.assign(option, {
11
- params: data,
12
- });
13
- return y_common({
14
- url: '/mv/fcgi-bin/getmv_by_tag',
15
- method,
16
- options,
17
- })
18
- .then(res => {
19
- const response = res.data;
20
- return {
21
- status: 200,
22
- body: {
23
- response,
24
- },
25
- };
26
- })
27
- .catch(error => {
28
- console.log('error', error);
29
- return {
30
- body: {
31
- error,
32
- },
33
- };
34
- });
35
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'GB2312',
7
+ cmd: 'shoubo',
8
+ lan: 'all',
9
+ });
10
+ const options = Object.assign(option, {
11
+ params: data,
12
+ });
13
+ return y_common({
14
+ url: '/mv/fcgi-bin/getmv_by_tag',
15
+ method,
16
+ options,
17
+ })
18
+ .then(res => {
19
+ const response = res.data;
20
+ return {
21
+ status: 200,
22
+ body: {
23
+ response,
24
+ },
25
+ };
26
+ })
27
+ .catch(error => {
28
+ console.log('error', error);
29
+ return {
30
+ body: {
31
+ error,
32
+ },
33
+ };
34
+ });
35
+ };
@@ -1,38 +1,38 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'utf-8',
7
- channel: 'radio',
8
- page: 'index',
9
- tpl: 'wk',
10
- new: 1,
11
- p: Math.round(1),
12
- });
13
- const options = Object.assign(option, {
14
- params: data,
15
- });
16
- return y_common({
17
- url: '/v8/fcg-bin/fcg_v8_radiolist.fcg',
18
- method,
19
- options,
20
- })
21
- .then(res => {
22
- const response = res.data;
23
- return {
24
- status: 200,
25
- body: {
26
- response,
27
- },
28
- };
29
- })
30
- .catch(error => {
31
- console.log('error', error);
32
- return {
33
- body: {
34
- error,
35
- },
36
- };
37
- });
38
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'utf-8',
7
+ channel: 'radio',
8
+ page: 'index',
9
+ tpl: 'wk',
10
+ new: 1,
11
+ p: Math.round(1),
12
+ });
13
+ const options = Object.assign(option, {
14
+ params: data,
15
+ });
16
+ return y_common({
17
+ url: '/v8/fcg-bin/fcg_v8_radiolist.fcg',
18
+ method,
19
+ options,
20
+ })
21
+ .then(res => {
22
+ const response = res.data;
23
+ return {
24
+ status: 200,
25
+ body: {
26
+ response,
27
+ },
28
+ };
29
+ })
30
+ .catch(error => {
31
+ console.log('error', error);
32
+ return {
33
+ body: {
34
+ error,
35
+ },
36
+ };
37
+ });
38
+ };
@@ -1,44 +1,44 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const hasCommonParams = false;
5
- const data = Object.assign(params, {
6
- format: 'json',
7
- outCharset: 'utf-8',
8
- platform: 'h5',
9
- needNewCode: 1,
10
- });
11
- const options = Object.assign(option, {
12
- params: data,
13
- });
14
- return y_common({
15
- url: '/v8/fcg-bin/fcg_myqq_toplist.fcg',
16
- method,
17
- options,
18
- hasCommonParams,
19
- })
20
- .then(res => {
21
- const response = res.data;
22
- if (typeof response === 'string') {
23
- const reg = /^\w+\(({[^()]+})\)$/;
24
- const matches = response.match(reg);
25
- if (matches) {
26
- response = JSON.parse(matches[1]);
27
- }
28
- }
29
- return {
30
- status: 200,
31
- body: {
32
- response,
33
- },
34
- };
35
- })
36
- .catch(error => {
37
- console.log('error', error);
38
- return {
39
- body: {
40
- error,
41
- },
42
- };
43
- });
44
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const hasCommonParams = false;
5
+ const data = Object.assign(params, {
6
+ format: 'json',
7
+ outCharset: 'utf-8',
8
+ platform: 'h5',
9
+ needNewCode: 1,
10
+ });
11
+ const options = Object.assign(option, {
12
+ params: data,
13
+ });
14
+ return y_common({
15
+ url: '/v8/fcg-bin/fcg_myqq_toplist.fcg',
16
+ method,
17
+ options,
18
+ hasCommonParams,
19
+ })
20
+ .then(res => {
21
+ let response = res.data;
22
+ if (typeof response === 'string') {
23
+ const reg = /^\w+\(({[^()]+})\)$/;
24
+ const matches = response.match(reg);
25
+ if (matches) {
26
+ response = JSON.parse(matches[1]);
27
+ }
28
+ }
29
+ return {
30
+ status: 200,
31
+ body: {
32
+ response,
33
+ },
34
+ };
35
+ })
36
+ .catch(error => {
37
+ console.log('error', error);
38
+ return {
39
+ body: {
40
+ error,
41
+ },
42
+ };
43
+ });
44
+ };
@@ -1,35 +1,35 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'utf-8',
7
- hostUin: 0,
8
- needNewCode: 0,
9
- });
10
- const options = Object.assign(option, {
11
- params: data,
12
- });
13
- return y_common({
14
- url: '/splcloud/fcgi-bin/gethotkey.fcg',
15
- method,
16
- options,
17
- })
18
- .then(res => {
19
- const response = res.data;
20
- return {
21
- status: 200,
22
- body: {
23
- response,
24
- },
25
- };
26
- })
27
- .catch(error => {
28
- console.log('error', error);
29
- return {
30
- body: {
31
- error,
32
- },
33
- };
34
- });
35
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'utf-8',
7
+ hostUin: 0,
8
+ needNewCode: 0,
9
+ });
10
+ const options = Object.assign(option, {
11
+ params: data,
12
+ });
13
+ return y_common({
14
+ url: '/splcloud/fcgi-bin/gethotkey.fcg',
15
+ method,
16
+ options,
17
+ })
18
+ .then(res => {
19
+ const response = res.data;
20
+ return {
21
+ status: 200,
22
+ body: {
23
+ response,
24
+ },
25
+ };
26
+ })
27
+ .catch(error => {
28
+ console.log('error', error);
29
+ return {
30
+ body: {
31
+ error,
32
+ },
33
+ };
34
+ });
35
+ };
@@ -1,45 +1,45 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'utf-8',
7
- ct: 24,
8
- qqmusic_ver: 1298,
9
- // https://github.com/Rain120/qq-music-api/issues/68
10
- // new_json: 1,
11
- remoteplace: 'txt.yqq.song',
12
- // searchid: 58932895599763136,
13
- t: 0,
14
- aggr: 1,
15
- cr: 1,
16
- lossless: 0,
17
- flag_qc: 0,
18
- platform: 'yqq.json',
19
- });
20
- const options = Object.assign(option, {
21
- params: data,
22
- });
23
- return y_common({
24
- url: '/soso/fcgi-bin/client_search_cp',
25
- method,
26
- options,
27
- })
28
- .then(res => {
29
- const response = res.data;
30
- return {
31
- status: 200,
32
- body: {
33
- response,
34
- },
35
- };
36
- })
37
- .catch(error => {
38
- console.log('error', error);
39
- return {
40
- body: {
41
- error,
42
- },
43
- };
44
- });
45
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'utf-8',
7
+ ct: 24,
8
+ qqmusic_ver: 1298,
9
+ // https://github.com/Rain120/qq-music-api/issues/68
10
+ // new_json: 1,
11
+ remoteplace: 'txt.yqq.song',
12
+ // searchid: 58932895599763136,
13
+ t: 0,
14
+ aggr: 1,
15
+ cr: 1,
16
+ lossless: 0,
17
+ flag_qc: 0,
18
+ platform: 'yqq.json',
19
+ });
20
+ const options = Object.assign(option, {
21
+ params: data,
22
+ });
23
+ return y_common({
24
+ url: '/soso/fcgi-bin/client_search_cp',
25
+ method,
26
+ options,
27
+ })
28
+ .then(res => {
29
+ const response = res.data;
30
+ return {
31
+ status: 200,
32
+ body: {
33
+ response,
34
+ },
35
+ };
36
+ })
37
+ .catch(error => {
38
+ console.log('error', error);
39
+ return {
40
+ body: {
41
+ error,
42
+ },
43
+ };
44
+ });
45
+ };
@@ -1,34 +1,34 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'utf-8',
7
- is_xml: 0,
8
- });
9
- const options = Object.assign(option, {
10
- params: data,
11
- });
12
- return y_common({
13
- url: '/splcloud/fcgi-bin/smartbox_new.fcg',
14
- method,
15
- options,
16
- })
17
- .then(res => {
18
- const response = res.data;
19
- return {
20
- status: 200,
21
- body: {
22
- response,
23
- },
24
- };
25
- })
26
- .catch(error => {
27
- console.log('error', error);
28
- return {
29
- body: {
30
- error,
31
- },
32
- };
33
- });
34
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'utf-8',
7
+ is_xml: 0,
8
+ });
9
+ const options = Object.assign(option, {
10
+ params: data,
11
+ });
12
+ return y_common({
13
+ url: '/splcloud/fcgi-bin/smartbox_new.fcg',
14
+ method,
15
+ options,
16
+ })
17
+ .then(res => {
18
+ const response = res.data;
19
+ return {
20
+ status: 200,
21
+ body: {
22
+ response,
23
+ },
24
+ };
25
+ })
26
+ .catch(error => {
27
+ console.log('error', error);
28
+ return {
29
+ body: {
30
+ error,
31
+ },
32
+ };
33
+ });
34
+ };
@@ -1,36 +1,36 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'utf-8',
7
- utf8: 1,
8
- start: 0,
9
- num: 5,
10
- });
11
- const options = Object.assign(option, {
12
- params: data,
13
- });
14
- return y_common({
15
- url: '/v8/fcg-bin/fcg_v8_simsinger.fcg',
16
- method,
17
- options,
18
- })
19
- .then(res => {
20
- const response = res.data;
21
- return {
22
- status: 200,
23
- body: {
24
- response,
25
- },
26
- };
27
- })
28
- .catch(error => {
29
- console.log('error', error);
30
- return {
31
- body: {
32
- error,
33
- },
34
- };
35
- });
36
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'utf-8',
7
+ utf8: 1,
8
+ start: 0,
9
+ num: 5,
10
+ });
11
+ const options = Object.assign(option, {
12
+ params: data,
13
+ });
14
+ return y_common({
15
+ url: '/v8/fcg-bin/fcg_v8_simsinger.fcg',
16
+ method,
17
+ options,
18
+ })
19
+ .then(res => {
20
+ const response = res.data;
21
+ return {
22
+ status: 200,
23
+ body: {
24
+ response,
25
+ },
26
+ };
27
+ })
28
+ .catch(error => {
29
+ console.log('error', error);
30
+ return {
31
+ body: {
32
+ error,
33
+ },
34
+ };
35
+ });
36
+ };
@@ -1,38 +1,38 @@
1
- const moment = require('moment');
2
- const y_common = require('../y_common');
3
-
4
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
5
- const hasCommonParams = false;
6
- const data = Object.assign(params, {
7
- format: 'xml',
8
- outCharset: 'utf-8',
9
- utf8: 1,
10
- r: moment().valueOf(),
11
- });
12
- const options = Object.assign(option, {
13
- params: data,
14
- });
15
- return y_common({
16
- url: '/splcloud/fcgi-bin/fcg_get_singer_desc.fcg',
17
- method,
18
- options,
19
- hasCommonParams,
20
- })
21
- .then(res => {
22
- const response = res.data;
23
- return {
24
- status: 200,
25
- body: {
26
- response,
27
- },
28
- };
29
- })
30
- .catch(error => {
31
- console.log('error', error);
32
- return {
33
- body: {
34
- error,
35
- },
36
- };
37
- });
38
- };
1
+ const dayjs = require('dayjs');
2
+ const y_common = require('../y_common');
3
+
4
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
5
+ const hasCommonParams = false;
6
+ const data = Object.assign(params, {
7
+ format: 'xml',
8
+ outCharset: 'utf-8',
9
+ utf8: 1,
10
+ r: dayjs().valueOf(),
11
+ });
12
+ const options = Object.assign(option, {
13
+ params: data,
14
+ });
15
+ return y_common({
16
+ url: '/splcloud/fcgi-bin/fcg_get_singer_desc.fcg',
17
+ method,
18
+ options,
19
+ hasCommonParams,
20
+ })
21
+ .then(res => {
22
+ const response = res.data;
23
+ return {
24
+ status: 200,
25
+ body: {
26
+ response,
27
+ },
28
+ };
29
+ })
30
+ .catch(error => {
31
+ console.log('error', error);
32
+ return {
33
+ body: {
34
+ error,
35
+ },
36
+ };
37
+ });
38
+ };
@@ -1,35 +1,35 @@
1
- const y_common = require('../y_common');
2
-
3
- module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
- const data = Object.assign(params, {
5
- format: 'json',
6
- outCharset: 'utf-8',
7
- cid: 205360581,
8
- begin: 0,
9
- });
10
- const options = Object.assign(option, {
11
- params: data,
12
- });
13
- return y_common({
14
- url: '/mv/fcgi-bin/fcg_singer_mv.fcg',
15
- method,
16
- options,
17
- })
18
- .then(res => {
19
- const response = res.data;
20
- return {
21
- status: 200,
22
- body: {
23
- response,
24
- },
25
- };
26
- })
27
- .catch(error => {
28
- console.log('error', error);
29
- return {
30
- body: {
31
- error,
32
- },
33
- };
34
- });
35
- };
1
+ const y_common = require('../y_common');
2
+
3
+ module.exports = ({ method = 'get', params = {}, option = {} }) => {
4
+ const data = Object.assign(params, {
5
+ format: 'json',
6
+ outCharset: 'utf-8',
7
+ cid: 205360581,
8
+ begin: 0,
9
+ });
10
+ const options = Object.assign(option, {
11
+ params: data,
12
+ });
13
+ return y_common({
14
+ url: '/mv/fcgi-bin/fcg_singer_mv.fcg',
15
+ method,
16
+ options,
17
+ })
18
+ .then(res => {
19
+ const response = res.data;
20
+ return {
21
+ status: 200,
22
+ body: {
23
+ response,
24
+ },
25
+ };
26
+ })
27
+ .catch(error => {
28
+ console.log('error', error);
29
+ return {
30
+ body: {
31
+ error,
32
+ },
33
+ };
34
+ });
35
+ };