@sansenjian/qq-music-api 1.0.6

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 (146) hide show
  1. package/.babelrc +3 -0
  2. package/.dockerignore +5 -0
  3. package/.editorconfig +31 -0
  4. package/.eslintrc.json +17 -0
  5. package/.github/FUNDING.yml +12 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  7. package/.github/ISSUE_TEMPLATE/custom.md +24 -0
  8. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  9. package/.prettierignore +1 -0
  10. package/.prettierrc +9 -0
  11. package/CHANGELOG.md +70 -0
  12. package/Dockerfile +18 -0
  13. package/LICENSE +21 -0
  14. package/QQ/351/237/263/344/271/220-v0.xmind +0 -0
  15. package/QQ/351/237/263/344/271/220-v1.xmind +0 -0
  16. package/README.md +177 -0
  17. package/app.js +75 -0
  18. package/commitlint.config.js +20 -0
  19. package/config/user-info.js +42 -0
  20. package/index.js +1 -0
  21. package/middlewares/koa-cors.js +97 -0
  22. package/module/apis/UCommon/UCommon.js +6 -0
  23. package/module/apis/album/getAlbumInfo.js +33 -0
  24. package/module/apis/comments/getComments.js +35 -0
  25. package/module/apis/digitalAlbum/getDigitalAlbumLists.js +34 -0
  26. package/module/apis/downloadQQMusic.js +41 -0
  27. package/module/apis/music/getLyric.js +41 -0
  28. package/module/apis/mv/getMvByTag.js +35 -0
  29. package/module/apis/radio/getRadioLists.js +38 -0
  30. package/module/apis/rank/getTopLists.js +44 -0
  31. package/module/apis/search/getHotKey.js +35 -0
  32. package/module/apis/search/getSearchByKey.js +45 -0
  33. package/module/apis/search/getSmartbox.js +34 -0
  34. package/module/apis/singers/getSimilarSinger.js +36 -0
  35. package/module/apis/singers/getSingerDesc.js +38 -0
  36. package/module/apis/singers/getSingerMv.js +35 -0
  37. package/module/apis/singers/getSingerStarNum.js +36 -0
  38. package/module/apis/songLists/songListCategories.js +33 -0
  39. package/module/apis/songLists/songListDetail.js +38 -0
  40. package/module/apis/songLists/songLists.js +41 -0
  41. package/module/apis/u_common.js +16 -0
  42. package/module/apis/user/checkQQLoginQr.js +86 -0
  43. package/module/apis/user/getQQLoginQr.js +11 -0
  44. package/module/apis/y_common.js +14 -0
  45. package/module/config.js +31 -0
  46. package/module/index.js +82 -0
  47. package/music.png +0 -0
  48. package/package.json +83 -0
  49. package/public/index.html +48 -0
  50. package/routers/context/batchGetSongInfo.js +59 -0
  51. package/routers/context/batchGetSongLists.js +50 -0
  52. package/routers/context/checkQQLoginQr.js +15 -0
  53. package/routers/context/cookies.js +36 -0
  54. package/routers/context/getAlbumInfo.js +27 -0
  55. package/routers/context/getComments.js +51 -0
  56. package/routers/context/getDigitalAlbumLists.js +14 -0
  57. package/routers/context/getDownloadQQMusic.js +14 -0
  58. package/routers/context/getHotkey.js +14 -0
  59. package/routers/context/getImageUrl.js +34 -0
  60. package/routers/context/getLyric.js +26 -0
  61. package/routers/context/getMusicPlay.js +112 -0
  62. package/routers/context/getMv.js +56 -0
  63. package/routers/context/getMvByTag.js +15 -0
  64. package/routers/context/getMvPlay.js +118 -0
  65. package/routers/context/getNewDisks.js +51 -0
  66. package/routers/context/getQQLoginQr.js +12 -0
  67. package/routers/context/getRadioLists.js +14 -0
  68. package/routers/context/getRanks.js +86 -0
  69. package/routers/context/getRecommend.js +86 -0
  70. package/routers/context/getSearchByKey.js +32 -0
  71. package/routers/context/getSimilarSinger.js +25 -0
  72. package/routers/context/getSingerAlbum.js +52 -0
  73. package/routers/context/getSingerDesc.js +25 -0
  74. package/routers/context/getSingerHotsong.js +52 -0
  75. package/routers/context/getSingerList.js +52 -0
  76. package/routers/context/getSingerMv.js +32 -0
  77. package/routers/context/getSingerStarNum.js +24 -0
  78. package/routers/context/getSmartbox.js +24 -0
  79. package/routers/context/getSongInfo.js +49 -0
  80. package/routers/context/getSongListCategories.js +22 -0
  81. package/routers/context/getSongListDetail.js +25 -0
  82. package/routers/context/getSongLists.js +32 -0
  83. package/routers/context/getTicketInfo.js +45 -0
  84. package/routers/context/getTopLists.js +15 -0
  85. package/routers/context/index.js +74 -0
  86. package/routers/router.js +112 -0
  87. package/screenshot/album-image.png +0 -0
  88. package/screenshot/batchGetSongInfo.png +0 -0
  89. package/screenshot/batchGetSongLists.png +0 -0
  90. package/screenshot/downloadQQMusic.png +0 -0
  91. package/screenshot/get-album-image.png +0 -0
  92. package/screenshot/get-play-all-data.png +0 -0
  93. package/screenshot/get-song-album-id.png +0 -0
  94. package/screenshot/get-song-id.png +0 -0
  95. package/screenshot/get-song-image.png +0 -0
  96. package/screenshot/getAlbumInfo.png +0 -0
  97. package/screenshot/getComments-id.png +0 -0
  98. package/screenshot/getComments-param.png +0 -0
  99. package/screenshot/getComments.png +0 -0
  100. package/screenshot/getDigitalAlbumLists.png +0 -0
  101. package/screenshot/getLyric-parse.png +0 -0
  102. package/screenshot/getLyric.png +0 -0
  103. package/screenshot/getMusicPlay.png +0 -0
  104. package/screenshot/getMv.png +0 -0
  105. package/screenshot/getMvByTag.png +0 -0
  106. package/screenshot/getMvPlay.png +0 -0
  107. package/screenshot/getNewDisks.png +0 -0
  108. package/screenshot/getRadioLists.png +0 -0
  109. package/screenshot/getRanks.png +0 -0
  110. package/screenshot/getRecommend.png +0 -0
  111. package/screenshot/getSearchByKey.png +0 -0
  112. package/screenshot/getSimilarSinger.png +0 -0
  113. package/screenshot/getSingerAlbum.png +0 -0
  114. package/screenshot/getSingerDesc.png +0 -0
  115. package/screenshot/getSingerHotsong.png +0 -0
  116. package/screenshot/getSingerList.png +0 -0
  117. package/screenshot/getSingerMv-default.png +0 -0
  118. package/screenshot/getSingerMv-listen.png +0 -0
  119. package/screenshot/getSingerMv-time.png +0 -0
  120. package/screenshot/getSingerStarNum.png +0 -0
  121. package/screenshot/getSmartbox.png +0 -0
  122. package/screenshot/getSongInfo.png +0 -0
  123. package/screenshot/getSongListCategories.png +0 -0
  124. package/screenshot/getSongListDetail.png +0 -0
  125. package/screenshot/getSongLists-params.png +0 -0
  126. package/screenshot/getSongLists.png +0 -0
  127. package/screenshot/getTicketInfo.png +0 -0
  128. package/screenshot/getTopLists.png +0 -0
  129. package/screenshot/gethotkey.png +0 -0
  130. package/screenshot/just-get-play-url.png +0 -0
  131. package/screenshot/musicPlay.png +0 -0
  132. package/screenshot/new-feature-error-tips.png +0 -0
  133. package/screenshot/normalize-cookie.png +0 -0
  134. package/screenshot/qq-music-v0.png +0 -0
  135. package/screenshot/qq-music.png +0 -0
  136. package/screenshot/song-image.png +0 -0
  137. package/screenshot/song-quality-128.png +0 -0
  138. package/screenshot/song-quality-m4a.png +0 -0
  139. package/scripts/build-images.js +36 -0
  140. package/scripts/commit-push.sh +103 -0
  141. package/util/colors.js +16 -0
  142. package/util/cookie.js +22 -0
  143. package/util/loginUtils.js +23 -0
  144. package/util/lyricParse.js +64 -0
  145. package/util/request.js +57 -0
  146. package/vercel.json +15 -0
package/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "plugins": ["@babel/plugin-transform-async-to-generator"]
3
+ }
package/.dockerignore ADDED
@@ -0,0 +1,5 @@
1
+ node_modules
2
+
3
+ npm-debug.log
4
+
5
+ docs/
package/.editorconfig ADDED
@@ -0,0 +1,31 @@
1
+ # http://editorconfig.org
2
+ # https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
3
+
4
+ # č”Øē¤ŗę˜Æęœ€é”¶å±‚ēš„é…ē½®ę–‡ä»¶, å‘ēŽ°č®¾äøŗtrueę—¶, ę‰ä¼šåœę­¢ęŸ„ę‰¾.editorconfigꖇ件
5
+ root = true
6
+
7
+ [*]
8
+ # tab space
9
+ indent_style = tab
10
+
11
+ indent_size = 2
12
+ # č®¾ē½®ę¢č”Œē¬¦, 值为lf, cr, crlf
13
+ end_of_line = lf
14
+ charset = utf-8
15
+
16
+ # ē”Øäø€äøŖę•“ę•°ę„č®¾ē½®tabē¼©čæ›ēš„åˆ—ę•°ć€‚é»˜č®¤ę˜Æindent_size
17
+ tab_width = indent_size
18
+
19
+ #ę˜Æå¦åˆ é™¤č”Œå°¾ēš„ē©ŗę ¼
20
+ trim_trailing_whitespace = true
21
+
22
+ #ę˜Æå¦åœØę–‡ä»¶ēš„ęœ€åŽę’å…„äø€äøŖē©ŗč”Œ
23
+ insert_final_newline = true
24
+
25
+ [*.md]
26
+ indent_size = 2
27
+ trim_trailing_whitespace = false
28
+ insert_final_newline = true
29
+
30
+ [Makefile]
31
+ indent_style = tab
package/.eslintrc.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "commonjs": true,
5
+ "es2020": true
6
+ },
7
+ "extends": "eslint:recommended",
8
+ "parserOptions": {
9
+ "ecmaVersion": 11
10
+ },
11
+ "rules": {
12
+ "indent": ["error", 2],
13
+ "linebreak-style": ["error", "unix"],
14
+ "quotes": ["error", "single"],
15
+ "semi": ["error", "always"]
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Custom issue template
3
+ about: Describe this issue template's purpose here.
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ### ēŽÆå¢ƒ
11
+
12
+ 系统:
13
+
14
+ nodejs ē‰ˆęœ¬(koa2č¦ę±‚ē‰ˆęœ¬ę˜Æ7.6.0+):
15
+
16
+ ### å‡ŗēŽ°é—®é¢˜
17
+
18
+ ### é‡ēŽ°ę­„éŖ¤
19
+
20
+ ### ęœŸå¾…ę•ˆęžœ
21
+
22
+ > é‡ēŽ°ę­„éŖ¤å°½é‡čÆ¦ē»†,äøčƒ½å«ē³Šäøęø…
23
+
24
+ > å¦‚ęžœäøę˜Æęå»ŗč®®,ꏐ issues å¦‚ęžœäøē…§ē€ęØ”ē‰ˆę„å°†äøä¼šä¼˜å…ˆå¤„ē†ęˆ–ē›“ęŽ„å…³é—­
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1 @@
1
+ node_modules/
package/.prettierrc ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "printWidth": 120,
3
+ "trailingComma": "all",
4
+ "tabWidth": 2,
5
+ "semi": true,
6
+ "singleQuote": true,
7
+ "bracketSpacing": true,
8
+ "arrowParens": "avoid"
9
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,70 @@
1
+ ## [1.0.4](https://github.com/Rain120/qq-music-api/compare/v1.0.3...v1.0.4) (2021-01-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * doc screenshot png path ([fe811e2](https://github.com/Rain120/qq-music-api/commit/fe811e26c0c0a2ed468728b0323866bd27b5a404))
7
+ * music play url quality; docs about cookie, music play; ([#35](https://github.com/Rain120/qq-music-api/issues/35)) ([f0b7923](https://github.com/Rain120/qq-music-api/commit/f0b7923b9feb7e32c44bc9417c2d426148ab3865))
8
+
9
+
10
+
11
+ ## [1.0.3](https://github.com/Rain120/qq-music-api/compare/v1.0.1...v1.0.3) (2021-01-24)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * doc screenshot png path ([cb8b253](https://github.com/Rain120/qq-music-api/commit/cb8b25358219ca1cc3e973e6f46a3f75bb3b8b29))
17
+
18
+
19
+ ### Features
20
+
21
+ * user cookie ([#32](https://github.com/Rain120/qq-music-api/issues/32)) ([5a32dae](https://github.com/Rain120/qq-music-api/commit/5a32daeca351c7b18352f9267db0c173fef9bff6))
22
+
23
+
24
+
25
+ ## [1.0.1](https://github.com/Rain120/qq-music-api/compare/v1.0.0...v1.0.1) (2020-12-25)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * build docker image sh ([fe395a4](https://github.com/Rain120/qq-music-api/commit/fe395a435efc0678d3d387abbcd6b33786bb72fa))
31
+
32
+
33
+ ### Features
34
+
35
+ * docker build images to hub for docker env run ([dcbbf95](https://github.com/Rain120/qq-music-api/commit/dcbbf95e70b305cd2ad4d00a7cc0bd4db5d0f8ab))
36
+ * docker repository version ([d74a425](https://github.com/Rain120/qq-music-api/commit/d74a4251da8c0c2dac2f5e4251e91f288f732d43))
37
+
38
+
39
+
40
+ # [1.0.0](https://github.com/Rain120/qq-music-api/compare/4d79041a5e5712c0c6bc6e6d55045f732636c80f...v1.0.0) (2020-09-15)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * bug about search by key https://github.com/Rain120/qq-music-api/issues/28 ([12b7d66](https://github.com/Rain120/qq-music-api/commit/12b7d667c05f92ad61545c5f75a82d878ad3220c))
46
+ * getComment ([#26](https://github.com/Rain120/qq-music-api/issues/26)) ([9e62be5](https://github.com/Rain120/qq-music-api/commit/9e62be539b3b78cdf0eea3e1696d9505ab242756))
47
+ * getSingerHotsong pagination ([#19](https://github.com/Rain120/qq-music-api/issues/19)) ([9bb705a](https://github.com/Rain120/qq-music-api/commit/9bb705a1b6eb4e2577ba20f0a279ccb63112390d))
48
+ * getSingerHotsong pagination ([#22](https://github.com/Rain120/qq-music-api/issues/22)) ([6d6dbf3](https://github.com/Rain120/qq-music-api/commit/6d6dbf36c545269ad7a6138e711e436a90d61e28))
49
+ * issue 14 about getRank topId was invalid ([024096f](https://github.com/Rain120/qq-music-api/commit/024096fa63144391680f1d6ec376929fee697c37))
50
+ * issue 14 about getRank which bug about period change by qq music api ([f13d2b5](https://github.com/Rain120/qq-music-api/commit/f13d2b540d860994600cc2728e4d848df574b2f4))
51
+ * issue: 12 -> (getHotkey -> getHotKey); axios option error; ([ee0371b](https://github.com/Rain120/qq-music-api/commit/ee0371b32352546feb8b60b7725dc3ff66a412ef))
52
+ * issue: 12, require getHotkey Camel-Case bug ([0eb9297](https://github.com/Rain120/qq-music-api/commit/0eb9297ff19773ef2d61377f341937f20a70d6a4))
53
+ * mv params bug: https://github.com/Rain120/qq-music-api/issues/16\#issuecomment-638230301 ([8f29b87](https://github.com/Rain120/qq-music-api/commit/8f29b874705ab0638310bcc13781a5599ab9de4d)), closes [#issuecomment-638230301](https://github.com/Rain120/qq-music-api/issues/issuecomment-638230301)
54
+ * song list params bug: https://github.com/Rain120/qq-music-api/issues/16 ([d9fb973](https://github.com/Rain120/qq-music-api/commit/d9fb9732f546cb76f208053a8dabd164aad893c5))
55
+
56
+
57
+ ### Features
58
+
59
+ * add song list ([c0e8de8](https://github.com/Rain120/qq-music-api/commit/c0e8de86dd93a907aa75e838c18d967b1434493d))
60
+ * batch get song info ([0ac4cfc](https://github.com/Rain120/qq-music-api/commit/0ac4cfca38e15e727d79f76c39e729a0ff3abc16))
61
+ * batch get songlist ([facc3cb](https://github.com/Rain120/qq-music-api/commit/facc3cbf7a44fbeb1db48bfa0c18e7918938b21c))
62
+ * eslint + prettier + commitlint + changelog + editorconfig ([e547ca3](https://github.com/Rain120/qq-music-api/commit/e547ca3c43db052769a06f5e0090a29749b721d5))
63
+ * get song info; rebuild the axios request, cut down route params ([4d79041](https://github.com/Rain120/qq-music-api/commit/4d79041a5e5712c0c6bc6e6d55045f732636c80f))
64
+ * getImageUrl; commit push shell; ([69f257a](https://github.com/Rain120/qq-music-api/commit/69f257a41d5d4746dce306c84ff902358a0d391c))
65
+ * rebuild router and axios ([0b737df](https://github.com/Rain120/qq-music-api/commit/0b737df8971a560119af2bcae199a1ea5549859c))
66
+ * rebuild router for lost ([2165b6a](https://github.com/Rain120/qq-music-api/commit/2165b6a8b5527bb2b68592b17e28846fce1e856f))
67
+ * rebuild routers ([1278008](https://github.com/Rain120/qq-music-api/commit/1278008d57bd8fb4bced800c3de6c6f16f0aee8f))
68
+
69
+
70
+
package/Dockerfile ADDED
@@ -0,0 +1,18 @@
1
+ FROM node:22
2
+
3
+ LABEL maintainer="Rain120 <1085131904@qq.com>"
4
+
5
+ # Create app directory
6
+ WORKDIR /app
7
+
8
+ COPY package.json .
9
+
10
+ RUN yarn install --registry=https://registry.npmmirror.com
11
+
12
+ COPY . .
13
+
14
+ EXPOSE 3200
15
+
16
+ ENTRYPOINT ["npm", "run"]
17
+
18
+ CMD ["start"]
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,177 @@
1
+ <h1 align="center">QQ Music API</h1>
2
+
3
+ <div align="center">
4
+
5
+ <img src='music.png' />
6
+
7
+ ![GitHub watchers](https://img.shields.io/github/watchers/rain120/qq-music-api?style=social) ![GitHub stars](https://img.shields.io/github/stars/rain120/qq-music-api?style=social) ![GitHub forks](https://img.shields.io/github/forks/rain120/qq-music-api?style=social)
8
+ <br />
9
+ ![node](https://img.shields.io/node/v/koa?style=flat-square)
10
+ <br />
11
+ ![GitHub repo size](https://img.shields.io/github/repo-size/rain120/qq-music-api?style=flat-square) ![GitHub package.json version](https://img.shields.io/github/package-json/v/rain120/qq-music-api?style=flat-square) ![GitHub](https://img.shields.io/github/license/rain120/qq-music-api?style=flat-square) ![GitHub open issues](https://img.shields.io/github/issues/rain120/qq-music-api?style=flat-square) ![GitHub closed issues](https://img.shields.io/github/issues-closed/rain120/qq-music-api) ![GitHub last commit](https://img.shields.io/github/last-commit/rain120/qq-music-api?style=flat-square) ![GitHub top language](https://img.shields.io/github/languages/top/rain120/qq-music-api?style=flat-square)
12
+
13
+ </div>
14
+
15
+ > QQ音乐API koa2 ē‰ˆęœ¬, é€ščæ‡Webē½‘é”µē‰ˆčÆ·ę±‚QQéŸ³ä¹ęŽ„å£ę•°ę®, ęœ‰é—®é¢˜čÆ·ę [issue](https://github.com/Rain120/qq-music-api/issues)
16
+
17
+ > å½“å‰ä»£ē ä»…ä¾›å­¦ä¹ ļ¼ŒäøåÆåšå•†äøšē”Øé€”
18
+
19
+ ### APIē»“ęž„å›¾
20
+
21
+ > ē›®å‰ęš‚ę—¶ę²”ęœ‰ę—¶é—“åšē™»å½•ęØ”å—ēš„ęŽ„å£ļ¼Œę¬¢čæŽå„ä½å¤§ä½¬ē»™ęˆ‘`PR`, é˜æé‡Œå˜Žå¤š
22
+
23
+ ![qq-music](./screenshot/qq-music.png)
24
+
25
+ ### ēŽÆå¢ƒč¦ę±‚
26
+
27
+ > å› äøŗęœ¬é”¹ē›®é‡‡ē”Øēš„ę˜Æ`koa2`, ę‰€ä»„čÆ·ē”®äæä½ ēš„`node`ē‰ˆęœ¬ę˜Æ7.6.0+
28
+
29
+ ```
30
+ node -v
31
+ ```
32
+ ### šŸ“¦ 安装
33
+
34
+ ```
35
+ git clone git@github.com:Rain120/qq-music-api.git
36
+ cd qq-music-api
37
+ npm install
38
+ ```
39
+
40
+ ### šŸ”Øé”¹ē›®åÆåŠØ
41
+ ```
42
+ // npm i -g nodemon
43
+ npm run start
44
+
45
+ // or don't install nodemon
46
+ node app.js
47
+ ```
48
+ é”¹ē›®ē›‘å¬ē«Æå£ę˜Æ`3200`
49
+
50
+ ### 🐳 Docker
51
+
52
+ ```sh
53
+ # local local build
54
+ npm run build:local-images
55
+
56
+ # local remote build
57
+ npm run build:remote-images
58
+
59
+ # build images
60
+ npm run build:images
61
+
62
+ # local run
63
+ npm run run:images
64
+
65
+ # remote run
66
+ docker pull qq-music-api
67
+ ```
68
+
69
+ ### åŠŸčƒ½ē‰¹ę€§
70
+
71
+ - [x] čŽ·å–ę­Œę›²ę’­ę”¾é“¾ęŽ„ **2021-01-24**
72
+
73
+ - [x] ę”ÆęŒč‡Ŗå®šä¹‰č®¾ē½® `cookie` **2021-01-23**
74
+
75
+ - [x] čŽ·å–ę­Œę›² + 专辑图片 **2020-05-24**
76
+
77
+ - [x] čŽ·å–ę­Œę‰‹ēƒ­é—Øę­Œę›² **2020-07-04**
78
+
79
+ - [x] čŽ·å–QQéŸ³ä¹äŗ§å“ēš„äø‹č½½åœ°å€
80
+
81
+ - [x] čŽ·å–ę­Œå•åˆ†ē±»
82
+
83
+ - [x] čŽ·å–ę­Œå•åˆ—č”Ø
84
+
85
+ - [x] čŽ·å–ę­Œå•čÆ¦ęƒ…
86
+
87
+ - [x] čŽ·å–MV标签
88
+
89
+ - [x] čŽ·å–MV播放俔息
90
+
91
+ - [x] čŽ·å–ę­Œę‰‹MV
92
+
93
+ - [x] čŽ·å–ē›øä¼¼ę­Œę‰‹
94
+
95
+ - [x] čŽ·å–ę­Œę‰‹äæ”ęÆ
96
+
97
+ - [x] čŽ·å–ę­Œę‰‹č¢«å…³ę³Øę•°é‡äæ”ęÆ
98
+
99
+ - [x] čŽ·å–ē”µå°åˆ—č”Ø
100
+
101
+ - [x] čŽ·å–äø“č¾‘
102
+
103
+ - [x] čŽ·å–ę•°å­—äø“č¾‘
104
+
105
+ - [x] čŽ·å–ę­Œę›²ę­ŒčÆ
106
+
107
+ - [x] čŽ·å–MV
108
+
109
+ - [x] čŽ·å–ę–°ē¢Ÿäæ”ęÆ
110
+
111
+ - [x] čŽ·å–ę­Œę‰‹äø“č¾‘
112
+
113
+ - [x] ~~čŽ·å–ę­Œę›²VKey~~ **2021-01-24**
114
+
115
+ - [x] čŽ·å–ęœē“¢ēƒ­čÆ
116
+
117
+ - [x] čŽ·å–å…³é”®å­—ęœē“¢ęē¤ŗ
118
+
119
+ - [x] čŽ·å–ęœē“¢ē»“ęžœ
120
+
121
+ - [x] čŽ·å–é¦–é”µęŽØč
122
+
123
+ - [x] čŽ·å–ęŽ’č”Œę¦œå•åˆ—č”Ø
124
+
125
+ - [x] čŽ·å–ęŽ’č”Œę¦œå•čÆ¦ęƒ…
126
+
127
+ - [x] čŽ·å–čÆ„č®ŗäæ”ęÆ(cmdä»£č”Øēš„ę„ę€ę²”å¤Ŗå¼„ę˜Žē™½)
128
+
129
+ - [x] čŽ·å–ē„ØåŠ”äæ”ęÆ
130
+
131
+ - [x] čŽ·å–ę­Œå•čÆ¦ęƒ…
132
+
133
+ - [x] čŽ·å–ę­Œę‰‹åˆ—č”Ø
134
+
135
+ ### 使用文攣
136
+
137
+ 使用`apis`详见[文攣](https://rain120.github.io/qq-music-api/#/)
138
+
139
+ ### å…³äŗŽé”¹ē›®
140
+
141
+ **ēµę„Ÿę„č‡Ŗ**
142
+
143
+ [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)
144
+
145
+ [Vue2.0å¼€å‘ä¼äøšēŗ§ē§»åŠØē«ÆéŸ³ä¹Web App](https://coding.imooc.com/class/107.html)
146
+
147
+ **å‚č€ƒå†…å®¹**
148
+
149
+ [Koa 2](https://koa.bootcss.com/)
150
+
151
+ [Axios](https://github.com/axios/axios)
152
+
153
+ [é˜®äø€å³°č€åøˆ - HTTP Referer 教程](http://www.ruanyifeng.com/blog/2019/06/http-referer.html)
154
+
155
+ ### é”¹ē›®äøč¶³
156
+
157
+ 1. å› äøŗęœ¬äŗŗę²”å†™čæ‡`unit test`, ę‰€ä»„ęœ¬é”¹ē›®å°šęœŖę·»åŠ `unit test`, ē­‰ęœ‰ę—¶é—“å†ę·»åŠ ;
158
+
159
+ 2. ē™»å½•čŽ·å–äøŖäŗŗäæ”ęÆē­‰ęŽ„å£éƒ½ę²”åš
160
+
161
+ #### šŸ¤ 蓔献 ![PR](https://img.shields.io/badge/PRs-Welcome-orange?style=flat-square&logo=appveyor)
162
+
163
+ We welcome all contributions. You can submit any ideas as [pull requests](https://github.com/Rain120/qq-music-api/pulls) or as a GitHub [issue](https://github.com/Rain120/qq-music-api/issues).
164
+
165
+ #### šŸ‘Øā€šŸ­ ä½œč€…
166
+
167
+ > Front-End development engineer, technology stack: React + Typescript + Mobx, also used Vue + Vuex for a while
168
+
169
+ - [Github](https://github.com/Rain120)
170
+ - [ēŸ„ä¹Ž](https://www.zhihu.com/people/yan-yang-nian-hua-120/activities)
171
+ - [ꎘ金](https://juejin.im/user/57c616496be3ff00584f54db)
172
+
173
+ #### šŸ“ License
174
+
175
+ [MIT](https://github.com/Rain120/qq-music-api/blob/master/LICENSE)
176
+
177
+ Copyright Ā© 2019-present [Rain120](https://github.com/Rain120).
package/app.js ADDED
@@ -0,0 +1,75 @@
1
+ require('@babel/register');
2
+ const Koa = require('koa');
3
+ const app = new Koa();
4
+ const bodyParser = require('koa-bodyparser');
5
+ const path = require('path');
6
+ const static = require('koa-static');
7
+ const exec = require('child_process').exec;
8
+ const chalk = require('chalk');
9
+
10
+ const cors = require('./middlewares/koa-cors');
11
+ const router = require('./routers/router');
12
+ const cookie = require('./util/cookie');
13
+ require('./util/colors');
14
+ const userInfo = require('./config/user-info');
15
+ const package = require('./package.json');
16
+ global.userInfo = Object.assign({}, userInfo);
17
+
18
+ console.log(chalk.green('\nšŸ„³šŸŽ‰ We had supported config the user cookies. \n'));
19
+
20
+ if (!(global.userInfo.loginUin || global.userInfo.uin)) {
21
+ console.log(chalk.yellow(`šŸ˜” The configuration ${chalk.red('loginUin')} or your ${chalk.red('cookie')} in file ${chalk.green('config/user-info')} has not configured. \n`));
22
+ }
23
+
24
+ if (!global.userInfo.cookie) {
25
+ console.log(chalk.yellow(`šŸ˜” The configuration ${chalk.red('cookie')} in file ${chalk.green('config/user-info')} has not configured. \n`));
26
+ }
27
+
28
+ exec('npm info QQ-Music-API version', (err, stdout, stderr) => {
29
+ if(!err){
30
+ let version = stdout.trim();
31
+ if(package.version < version){
32
+ console.log(`Current Version: ${version}, Current Version: ${package.version}, Please update it.`.prompt);
33
+ }
34
+ }
35
+ });
36
+
37
+ app.use(bodyParser());
38
+ app.use(cookie());
39
+ app.use(static(
40
+ path.join(__dirname, 'public')
41
+ ));
42
+
43
+ // logger
44
+ app.use(async (ctx, next) => {
45
+ await next();
46
+ const rt = ctx.response.get('X-Response-Time');
47
+ console.log(`${ctx.method} ${ctx.url} - ${rt}`.prompt);
48
+ });
49
+
50
+ // cors
51
+ app.use(cors({
52
+ origin: (ctx) => ctx.request.header.origin,
53
+ exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],
54
+ maxAge: 5,
55
+ credentials: true,
56
+ allowMethods: ['GET', 'POST', 'DELETE'],
57
+ allowHeaders: ['Content-Type', 'Authorization', 'Accept'],
58
+ }));
59
+
60
+ // x-response-time
61
+ app.use(async (ctx, next) => {
62
+ const start = Date.now();
63
+ await next();
64
+ const ms = Date.now() - start;
65
+ ctx.set('X-Response-Time', `${ms}ms`);
66
+ });
67
+
68
+ app.use(router.routes())
69
+ .use(router.allowedMethods());
70
+
71
+ const PORT = process.env.PORT || 3200;
72
+
73
+ app.listen(PORT, () => {
74
+ console.log(`server running @ http://localhost:${PORT}`.prompt);
75
+ });
@@ -0,0 +1,20 @@
1
+ /*
2
+ * @Author: Rainy
3
+ * @Date: 2020-07-03 18:47:30
4
+ * @LastEditors: Rainy
5
+ * @LastEditTime: 2020-07-03 18:51:11
6
+ */
7
+
8
+ module.exports = {
9
+ extends: ['@commitlint/config-conventional'],
10
+ rules: {
11
+ 'type-enum': [
12
+ 2,
13
+ 'always',
14
+ ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'build', 'ci', 'chore', 'revert', 'config'],
15
+ ],
16
+ 'subject-full-stop': [0, 'never'],
17
+ 'subject-case': [0, 'never'],
18
+ 'header-max-length': [0, 'always', 150],
19
+ },
20
+ };
@@ -0,0 +1,42 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+
4
+ let userInfo, cookieList, cookieObject;
5
+ const infoPath = path.join(__dirname, './user-info.json');
6
+ fs.existsSync(infoPath) || fs.writeFileSync(infoPath, '{}', 'utf-8');
7
+
8
+ const initData = () => {
9
+
10
+ userInfo = { loginUin: '', cookie: '', ...JSON.parse(fs.readFileSync(infoPath, 'utf-8')) };
11
+ cookieList = userInfo.cookie.split('; ').map(_ => _.trim());
12
+
13
+ cookieObject = {};
14
+ cookieList.filter(Boolean).forEach(_ => {
15
+ if (_) {
16
+ const [key, value = ''] = _.split('=');
17
+
18
+ cookieObject[key] = value;
19
+ }
20
+ });
21
+ };
22
+
23
+ const refreshData = cookie => {
24
+ const uin = cookie.match(/ uin=([^;]+)/)[1];
25
+ fs.writeFileSync(infoPath, JSON.stringify({ loginUin: uin, cookie: cookie }), 'utf-8');
26
+ initData();
27
+ return {
28
+ ...userInfo,
29
+ uin: userInfo.loginUin || cookieObject.uin,
30
+ cookieList,
31
+ cookieObject
32
+ };
33
+ };
34
+
35
+ initData();
36
+
37
+ module.exports = Object.assign(userInfo, {
38
+ uin: userInfo.loginUin || cookieObject.uin,
39
+ cookieList,
40
+ cookieObject,
41
+ refreshData
42
+ });
package/index.js ADDED
@@ -0,0 +1 @@
1
+ require('./app.js')