@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
package/module/config.js CHANGED
@@ -1,31 +1,31 @@
1
- const commonParams = {
2
- g_tk: 1124214810,
3
- loginUin: global.userInfo?.uin || '0',
4
- hostUin: 0,
5
- inCharset: 'utf8',
6
- outCharset: 'utf-8',
7
- // format: 'json',
8
- notice: 0,
9
- platform: 'yqq.json',
10
- needNewCode: 0,
11
- };
12
-
13
- const _guid = (Math.round(2147483647 * Math.random()) * new Date().getUTCMilliseconds()) % 1e10;
14
-
15
- const options = {
16
- param: 'jsonpCallback',
17
- prefix: 'tan',
18
- // prefix: 'jp',
19
- };
20
-
21
- const optionsPrefix = {
22
- param: 'jsonpCallback',
23
- prefix: 'playlistinfoCallback',
24
- };
25
-
26
- module.exports = {
27
- commonParams,
28
- _guid,
29
- options,
30
- optionsPrefix,
31
- };
1
+ const commonParams = {
2
+ g_tk: 1124214810,
3
+ loginUin: global.userInfo?.uin || '0',
4
+ hostUin: 0,
5
+ inCharset: 'utf8',
6
+ outCharset: 'utf-8',
7
+ // format: 'json',
8
+ notice: 0,
9
+ platform: 'yqq.json',
10
+ needNewCode: 0,
11
+ };
12
+
13
+ const _guid = (Math.round(2147483647 * Math.random()) * new Date().getUTCMilliseconds()) % 1e10;
14
+
15
+ const options = {
16
+ param: 'jsonpCallback',
17
+ prefix: 'tan',
18
+ // prefix: 'jp',
19
+ };
20
+
21
+ const optionsPrefix = {
22
+ param: 'jsonpCallback',
23
+ prefix: 'playlistinfoCallback',
24
+ };
25
+
26
+ module.exports = {
27
+ commonParams,
28
+ _guid,
29
+ options,
30
+ optionsPrefix,
31
+ };
package/module/index.js CHANGED
@@ -1,82 +1,82 @@
1
- const downloadQQMusic = require('./apis/downloadQQMusic');
2
- // search
3
- const getHotKey = require('./apis/search/getHotKey');
4
- const getSearchByKey = require('./apis/search/getSearchByKey');
5
- const getSmartbox = require('./apis/search/getSmartbox');
6
-
7
- // song list
8
- const songLists = require('./apis/songLists/songLists');
9
- const songListCategories = require('./apis/songLists/songListCategories');
10
- const songListDetail = require('./apis/songLists/songListDetail');
11
-
12
- // MV
13
- const getMvByTag = require('./apis/mv/getMvByTag');
14
-
15
- // singer
16
- const getSimilarSinger = require('./apis/singers/getSimilarSinger');
17
- const getSingerMv = require('./apis/singers/getSingerMv');
18
- const getSingerDesc = require('./apis/singers/getSingerDesc');
19
- const getSingerStarNum = require('./apis/singers/getSingerStarNum');
20
-
21
- // radio
22
- const getRadioLists = require('./apis/radio/getRadioLists');
23
-
24
- // DigitalAlbum
25
- const getDigitalAlbumLists = require('./apis/digitalAlbum/getDigitalAlbumLists');
26
-
27
- // music
28
- const getLyric = require('./apis/music/getLyric');
29
-
30
- // album
31
- const getAlbumInfo = require('./apis/album/getAlbumInfo');
32
-
33
- // comments
34
- const getComments = require('./apis/comments/getComments');
35
-
36
- // UCommon
37
- const UCommon = require('./apis/UCommon/UCommon');
38
-
39
- // getTopLists
40
- const getTopLists = require('./apis/rank/getTopLists');
41
-
42
- // getQQLoginQr
43
- const getQQLoginQr = require('./apis/user/getQQLoginQr');
44
-
45
- // checkQQLoginQr
46
- const checkQQLoginQr = require('./apis/user/checkQQLoginQr');
47
-
48
- module.exports = {
49
- downloadQQMusic,
50
- // search
51
- getHotKey,
52
- getSearchByKey,
53
- getSmartbox,
54
- // song lists
55
- songLists,
56
- songListCategories,
57
- songListDetail,
58
- // MV
59
- getMvByTag,
60
- // singer
61
- getSimilarSinger,
62
- getSingerMv,
63
- getSingerDesc,
64
- getSingerStarNum,
65
- // radio
66
- getRadioLists,
67
- // DigitalAlbum
68
- getDigitalAlbumLists,
69
- // music
70
- getLyric,
71
- // album
72
- getAlbumInfo,
73
- // comments
74
- getComments,
75
- // UCommon
76
- UCommon,
77
- // getTopLists
78
- getTopLists,
79
- // login
80
- getQQLoginQr,
81
- checkQQLoginQr
82
- };
1
+ const downloadQQMusic = require('./apis/downloadQQMusic');
2
+ // search
3
+ const getHotKey = require('./apis/search/getHotKey');
4
+ const getSearchByKey = require('./apis/search/getSearchByKey');
5
+ const getSmartbox = require('./apis/search/getSmartbox');
6
+
7
+ // song list
8
+ const songLists = require('./apis/songLists/songLists');
9
+ const songListCategories = require('./apis/songLists/songListCategories');
10
+ const songListDetail = require('./apis/songLists/songListDetail');
11
+
12
+ // MV
13
+ const getMvByTag = require('./apis/mv/getMvByTag');
14
+
15
+ // singer
16
+ const getSimilarSinger = require('./apis/singers/getSimilarSinger');
17
+ const getSingerMv = require('./apis/singers/getSingerMv');
18
+ const getSingerDesc = require('./apis/singers/getSingerDesc');
19
+ const getSingerStarNum = require('./apis/singers/getSingerStarNum');
20
+
21
+ // radio
22
+ const getRadioLists = require('./apis/radio/getRadioLists');
23
+
24
+ // DigitalAlbum
25
+ const getDigitalAlbumLists = require('./apis/digitalAlbum/getDigitalAlbumLists');
26
+
27
+ // music
28
+ const getLyric = require('./apis/music/getLyric');
29
+
30
+ // album
31
+ const getAlbumInfo = require('./apis/album/getAlbumInfo');
32
+
33
+ // comments
34
+ const getComments = require('./apis/comments/getComments');
35
+
36
+ // UCommon
37
+ const UCommon = require('./apis/UCommon/UCommon');
38
+
39
+ // getTopLists
40
+ const getTopLists = require('./apis/rank/getTopLists');
41
+
42
+ // getQQLoginQr
43
+ const getQQLoginQr = require('./apis/user/getQQLoginQr');
44
+
45
+ // checkQQLoginQr
46
+ const checkQQLoginQr = require('./apis/user/checkQQLoginQr');
47
+
48
+ module.exports = {
49
+ downloadQQMusic,
50
+ // search
51
+ getHotKey,
52
+ getSearchByKey,
53
+ getSmartbox,
54
+ // song lists
55
+ songLists,
56
+ songListCategories,
57
+ songListDetail,
58
+ // MV
59
+ getMvByTag,
60
+ // singer
61
+ getSimilarSinger,
62
+ getSingerMv,
63
+ getSingerDesc,
64
+ getSingerStarNum,
65
+ // radio
66
+ getRadioLists,
67
+ // DigitalAlbum
68
+ getDigitalAlbumLists,
69
+ // music
70
+ getLyric,
71
+ // album
72
+ getAlbumInfo,
73
+ // comments
74
+ getComments,
75
+ // UCommon
76
+ UCommon,
77
+ // getTopLists
78
+ getTopLists,
79
+ // login
80
+ getQQLoginQr,
81
+ checkQQLoginQr,
82
+ };
package/package.json CHANGED
@@ -1,83 +1,72 @@
1
- {
2
- "name": "@sansenjian/qq-music-api",
3
- "version": "1.0.6",
4
- "description": "QQ Music API - QQ音乐API koa2实现",
5
- "main": "index.js",
6
- "scripts": {
7
- "dev": "nodemon app.js & npm run docs",
8
- "start": "node app.js",
9
- "docs": "docsify serve docs -p 9611",
10
- "commit-push": "./scripts/commit-push.sh",
11
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
12
- "eslint": "eslint --fix --color module/**/** routers/**/** util/**/**",
13
- "prettier": "prettier --write --tab-width=2 module/**/** routers/**/** util/**/**",
14
- "lint-staged": "lint-staged",
15
- "build:local-images": "node ./scripts/build-images.js local",
16
- "build:remote-images": "node ./scripts/build-images.js remote",
17
- "build:images": "npm run build:local-images && npm run build:remote-images",
18
- "run:images": "docker run -d --name qq-music-api -p 3200:3200 qq-music-api "
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+ssh://git@github.com/sansenjian/qq-music-api.git"
23
- },
24
- "keywords": [
25
- "QQ音乐",
26
- "音乐",
27
- "QQ音乐koa2",
28
- "qq-music-api"
29
- ],
30
- "author": "sansenjian",
31
- "license": "MIT",
32
- "bugs": {
33
- "url": "https://github.com/sansenjian/qq-music-api/issues"
34
- },
35
- "homepage": "https://github.com/sansenjian/qq-music-api#readme",
36
- "lint-staged": {
37
- "*.{js}": [
38
- "npm run prettier",
39
- "npm run changelog"
40
- ]
41
- },
42
- "husky": {
43
- "hooks": {
44
- "pre-commit": [
45
- "lint-staged"
46
- ],
47
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
48
- }
49
- },
50
- "dependencies": {
51
- "axios": "^0.21.1",
52
- "koa": "^2.7.0",
53
- "koa-bodyparser": "^4.2.1",
54
- "koa-router": "^7.4.0",
55
- "koa-static": "^5.0.0",
56
- "lodash.get": "^4.4.2",
57
- "moment": "^2.24.0"
58
- },
59
- "devDependencies": {
60
- "@babel/core": "^7.4.5",
61
- "@babel/plugin-transform-async-to-generator": "^7.4.4",
62
- "@babel/register": "^7.4.4",
63
- "@commitlint/cli": "^9.0.1",
64
- "@commitlint/config-conventional": "^12.0.0",
65
- "chalk": "^4.1.0",
66
- "colors": "^1.3.3",
67
- "conventional-changelog-cli": "^2.0.34",
68
- "docsify-cli": "^4.4.2",
69
- "eslint": "^7.3.1",
70
- "eslint-config-standard": "^14.1.1",
71
- "eslint-plugin-import": "^2.22.0",
72
- "eslint-plugin-node": "^11.1.0",
73
- "eslint-plugin-promise": "^4.2.1",
74
- "eslint-plugin-standard": "^4.0.1",
75
- "husky": "^4.2.5",
76
- "lint-staged": "^10.2.11",
77
- "nodemon": "^2.0.4",
78
- "prettier": "^2.0.5"
79
- },
80
- "engines": {
81
- "node": ">=7.6.0"
82
- }
83
- }
1
+ {
2
+ "name": "@sansenjian/qq-music-api",
3
+ "version": "2.0.0",
4
+ "description": "QQ Music API - QQ音乐API koa2实现",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "dev": "nodemon app.js & npm run docs",
8
+ "start": "node app.js",
9
+ "docs": "docsify serve docs -p 9611",
10
+ "commit-push": "./scripts/commit-push.sh",
11
+ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
12
+ "eslint": "eslint --fix --color module/**/** routers/**/** util/**/**",
13
+ "prettier": "prettier --write --tab-width=2 module/**/** routers/**/** util/**/**",
14
+ "lint-staged": "lint-staged",
15
+ "build:local-images": "node ./scripts/build-images.js local",
16
+ "build:remote-images": "node ./scripts/build-images.js remote",
17
+ "build:images": "npm run build:local-images && npm run build:remote-images",
18
+ "run:images": "docker run -d --name qq-music-api -p 3200:3200 qq-music-api "
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+ssh://git@github.com/sansenjian/qq-music-api.git"
23
+ },
24
+ "keywords": [
25
+ "QQ音乐",
26
+ "音乐",
27
+ "QQ音乐koa2",
28
+ "qq-music-api"
29
+ ],
30
+ "author": "sansenjian",
31
+ "license": "MIT",
32
+ "bugs": {
33
+ "url": "https://github.com/sansenjian/qq-music-api/issues"
34
+ },
35
+ "homepage": "https://github.com/sansenjian/qq-music-api#readme",
36
+ "lint-staged": {
37
+ "*.{js}": [
38
+ "npm run prettier",
39
+ "npm run changelog"
40
+ ]
41
+ },
42
+ "dependencies": {
43
+ "@koa/router": "^12.0.0",
44
+ "axios": "^1.6.0",
45
+ "dayjs": "^1.11.10",
46
+ "koa": "^2.15.0",
47
+ "koa-bodyparser": "^4.4.0",
48
+ "koa-static": "^5.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@babel/core": "^7.23.0",
52
+ "@babel/plugin-transform-async-to-generator": "^7.23.0",
53
+ "@babel/register": "^7.23.0",
54
+ "@commitlint/cli": "^18.0.0",
55
+ "@commitlint/config-conventional": "^18.0.0",
56
+ "chalk": "^4.1.0",
57
+ "conventional-changelog-cli": "^4.0.0",
58
+ "docsify-cli": "^4.4.4",
59
+ "eslint": "^8.56.0",
60
+ "eslint-config-standard": "^17.0.0",
61
+ "eslint-plugin-import": "^2.29.0",
62
+ "eslint-plugin-n": "^16.0.0",
63
+ "eslint-plugin-promise": "^6.0.0",
64
+ "husky": "^9.0.0",
65
+ "lint-staged": "^15.0.0",
66
+ "nodemon": "^3.0.0",
67
+ "prettier": "^3.0.0"
68
+ },
69
+ "engines": {
70
+ "node": ">=18.0.0"
71
+ }
72
+ }
package/public/index.html CHANGED
@@ -1,48 +1,48 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
- <title>QQ 音乐API</title>
8
- </head>
9
- <body>
10
- <h1>QQ 音乐API</h1>
11
- 当你看到这个页面时,这个服务已经成功跑起来了~
12
- <a href="https://rain120.github.io/qq-music-api/">查看文档</a>
13
- <h2>例子:</h2>
14
- <ul>
15
- <li>1. <a href="/getHotkey">搜索热词</a></li>
16
- <li>2. <a href="/getSongLists?categoryId=10000000">歌单列表</a></li>
17
- <li>3. <a href="/getSearchByKey?key=周杰伦">获取搜索结果</a></li>
18
- </ul>
19
- <style>
20
- html,body{
21
- height: 100vh;
22
- width: 100vw;
23
- margin: 0;
24
- padding: 0;
25
- background: #ffffff;
26
- text-align: center;
27
- margin-top:30px;
28
- overflow: hidden;
29
- }
30
- *{
31
- color:rgb(100,100,100);
32
- }
33
- a{
34
- color:#42b983;
35
- }
36
- ul,li{
37
- margin: 0;
38
- }
39
- ul{
40
- margin-left: -40px;
41
- line-height: 30px;
42
- }
43
- li{
44
- list-style: none;
45
- }
46
- </style>
47
- </body>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+ <title>QQ 音乐API</title>
8
+ </head>
9
+ <body>
10
+ <h1>QQ 音乐API</h1>
11
+ 当你看到这个页面时,这个服务已经成功跑起来了~
12
+ <a href="https://rain120.github.io/qq-music-api/">查看文档</a>
13
+ <h2>例子:</h2>
14
+ <ul>
15
+ <li>1. <a href="/getHotkey">搜索热词</a></li>
16
+ <li>2. <a href="/getSongLists?categoryId=10000000">歌单列表</a></li>
17
+ <li>3. <a href="/getSearchByKey?key=周杰伦">获取搜索结果</a></li>
18
+ </ul>
19
+ <style>
20
+ html,body{
21
+ height: 100vh;
22
+ width: 100vw;
23
+ margin: 0;
24
+ padding: 0;
25
+ background: #ffffff;
26
+ text-align: center;
27
+ margin-top:30px;
28
+ overflow: hidden;
29
+ }
30
+ *{
31
+ color:rgb(100,100,100);
32
+ }
33
+ a{
34
+ color:#42b983;
35
+ }
36
+ ul,li{
37
+ margin: 0;
38
+ }
39
+ ul{
40
+ margin-left: -40px;
41
+ line-height: 30px;
42
+ }
43
+ li{
44
+ list-style: none;
45
+ }
46
+ </style>
47
+ </body>
48
48
  </html>
@@ -1,59 +1,59 @@
1
- const { UCommon } = require('../../module');
2
- const { commonParams } = require('../../module/config');
3
- /**
4
- * @description: 2, 3
5
- * @param songs 歌曲信息 [[songmid, songid]]
6
- * @return:
7
- */
8
- module.exports = async (ctx, next) => {
9
- const { songs } = ctx.request.body;
10
-
11
- const params = Object.assign(commonParams, {
12
- format: 'json',
13
- inCharset: 'utf8',
14
- outCharset: 'utf-8',
15
- notice: 0,
16
- platform: 'yqq.json',
17
- needNewCode: 0,
18
- });
19
-
20
- const props = {
21
- method: 'get',
22
- option: {},
23
- params,
24
- };
25
-
26
- const data = await Promise.all(
27
- (songs || []).map(async song => {
28
- const [song_mid, song_id = ''] = song;
29
- console.log(song_mid, song_id);
30
- return await UCommon({
31
- ...props,
32
- params: {
33
- ...params,
34
- data: {
35
- comm: {
36
- ct: 24,
37
- cv: 0,
38
- },
39
- songinfo: {
40
- method: 'get_song_detail_yqq',
41
- param: {
42
- song_type: 0,
43
- song_mid,
44
- song_id,
45
- },
46
- module: 'music.pf_song_detail_svr',
47
- },
48
- },
49
- },
50
- }).then(res => res.data);
51
- }),
52
- );
53
- Object.assign(ctx, {
54
- body: {
55
- status: 200,
56
- data,
57
- },
58
- });
59
- };
1
+ const { UCommon } = require('../../module');
2
+ const { commonParams } = require('../../module/config');
3
+ /**
4
+ * @description: 2, 3
5
+ * @param songs 歌曲信息 [[songmid, songid]]
6
+ * @return:
7
+ */
8
+ module.exports = async (ctx, next) => {
9
+ const { songs } = ctx.request.body;
10
+
11
+ const params = Object.assign(commonParams, {
12
+ format: 'json',
13
+ inCharset: 'utf8',
14
+ outCharset: 'utf-8',
15
+ notice: 0,
16
+ platform: 'yqq.json',
17
+ needNewCode: 0,
18
+ });
19
+
20
+ const props = {
21
+ method: 'get',
22
+ option: {},
23
+ params,
24
+ };
25
+
26
+ const data = await Promise.all(
27
+ (songs || []).map(async song => {
28
+ const [song_mid, song_id = ''] = song;
29
+ console.log(song_mid, song_id);
30
+ return await UCommon({
31
+ ...props,
32
+ params: {
33
+ ...params,
34
+ data: {
35
+ comm: {
36
+ ct: 24,
37
+ cv: 0,
38
+ },
39
+ songinfo: {
40
+ method: 'get_song_detail_yqq',
41
+ param: {
42
+ song_type: 0,
43
+ song_mid,
44
+ song_id,
45
+ },
46
+ module: 'music.pf_song_detail_svr',
47
+ },
48
+ },
49
+ },
50
+ }).then(res => res.data);
51
+ }),
52
+ );
53
+ Object.assign(ctx, {
54
+ body: {
55
+ status: 200,
56
+ data,
57
+ },
58
+ });
59
+ };