@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.
- package/.babelrc +3 -0
- package/.dockerignore +5 -0
- package/.editorconfig +31 -0
- package/.eslintrc.json +17 -0
- package/.github/FUNDING.yml +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/custom.md +24 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.prettierignore +1 -0
- package/.prettierrc +9 -0
- package/CHANGELOG.md +70 -0
- package/Dockerfile +18 -0
- package/LICENSE +21 -0
- package/QQ/351/237/263/344/271/220-v0.xmind +0 -0
- package/QQ/351/237/263/344/271/220-v1.xmind +0 -0
- package/README.md +177 -0
- package/app.js +75 -0
- package/commitlint.config.js +20 -0
- package/config/user-info.js +42 -0
- package/index.js +1 -0
- package/middlewares/koa-cors.js +97 -0
- package/module/apis/UCommon/UCommon.js +6 -0
- package/module/apis/album/getAlbumInfo.js +33 -0
- package/module/apis/comments/getComments.js +35 -0
- package/module/apis/digitalAlbum/getDigitalAlbumLists.js +34 -0
- package/module/apis/downloadQQMusic.js +41 -0
- package/module/apis/music/getLyric.js +41 -0
- package/module/apis/mv/getMvByTag.js +35 -0
- package/module/apis/radio/getRadioLists.js +38 -0
- package/module/apis/rank/getTopLists.js +44 -0
- package/module/apis/search/getHotKey.js +35 -0
- package/module/apis/search/getSearchByKey.js +45 -0
- package/module/apis/search/getSmartbox.js +34 -0
- package/module/apis/singers/getSimilarSinger.js +36 -0
- package/module/apis/singers/getSingerDesc.js +38 -0
- package/module/apis/singers/getSingerMv.js +35 -0
- package/module/apis/singers/getSingerStarNum.js +36 -0
- package/module/apis/songLists/songListCategories.js +33 -0
- package/module/apis/songLists/songListDetail.js +38 -0
- package/module/apis/songLists/songLists.js +41 -0
- package/module/apis/u_common.js +16 -0
- package/module/apis/user/checkQQLoginQr.js +86 -0
- package/module/apis/user/getQQLoginQr.js +11 -0
- package/module/apis/y_common.js +14 -0
- package/module/config.js +31 -0
- package/module/index.js +82 -0
- package/music.png +0 -0
- package/package.json +83 -0
- package/public/index.html +48 -0
- package/routers/context/batchGetSongInfo.js +59 -0
- package/routers/context/batchGetSongLists.js +50 -0
- package/routers/context/checkQQLoginQr.js +15 -0
- package/routers/context/cookies.js +36 -0
- package/routers/context/getAlbumInfo.js +27 -0
- package/routers/context/getComments.js +51 -0
- package/routers/context/getDigitalAlbumLists.js +14 -0
- package/routers/context/getDownloadQQMusic.js +14 -0
- package/routers/context/getHotkey.js +14 -0
- package/routers/context/getImageUrl.js +34 -0
- package/routers/context/getLyric.js +26 -0
- package/routers/context/getMusicPlay.js +112 -0
- package/routers/context/getMv.js +56 -0
- package/routers/context/getMvByTag.js +15 -0
- package/routers/context/getMvPlay.js +118 -0
- package/routers/context/getNewDisks.js +51 -0
- package/routers/context/getQQLoginQr.js +12 -0
- package/routers/context/getRadioLists.js +14 -0
- package/routers/context/getRanks.js +86 -0
- package/routers/context/getRecommend.js +86 -0
- package/routers/context/getSearchByKey.js +32 -0
- package/routers/context/getSimilarSinger.js +25 -0
- package/routers/context/getSingerAlbum.js +52 -0
- package/routers/context/getSingerDesc.js +25 -0
- package/routers/context/getSingerHotsong.js +52 -0
- package/routers/context/getSingerList.js +52 -0
- package/routers/context/getSingerMv.js +32 -0
- package/routers/context/getSingerStarNum.js +24 -0
- package/routers/context/getSmartbox.js +24 -0
- package/routers/context/getSongInfo.js +49 -0
- package/routers/context/getSongListCategories.js +22 -0
- package/routers/context/getSongListDetail.js +25 -0
- package/routers/context/getSongLists.js +32 -0
- package/routers/context/getTicketInfo.js +45 -0
- package/routers/context/getTopLists.js +15 -0
- package/routers/context/index.js +74 -0
- package/routers/router.js +112 -0
- package/screenshot/album-image.png +0 -0
- package/screenshot/batchGetSongInfo.png +0 -0
- package/screenshot/batchGetSongLists.png +0 -0
- package/screenshot/downloadQQMusic.png +0 -0
- package/screenshot/get-album-image.png +0 -0
- package/screenshot/get-play-all-data.png +0 -0
- package/screenshot/get-song-album-id.png +0 -0
- package/screenshot/get-song-id.png +0 -0
- package/screenshot/get-song-image.png +0 -0
- package/screenshot/getAlbumInfo.png +0 -0
- package/screenshot/getComments-id.png +0 -0
- package/screenshot/getComments-param.png +0 -0
- package/screenshot/getComments.png +0 -0
- package/screenshot/getDigitalAlbumLists.png +0 -0
- package/screenshot/getLyric-parse.png +0 -0
- package/screenshot/getLyric.png +0 -0
- package/screenshot/getMusicPlay.png +0 -0
- package/screenshot/getMv.png +0 -0
- package/screenshot/getMvByTag.png +0 -0
- package/screenshot/getMvPlay.png +0 -0
- package/screenshot/getNewDisks.png +0 -0
- package/screenshot/getRadioLists.png +0 -0
- package/screenshot/getRanks.png +0 -0
- package/screenshot/getRecommend.png +0 -0
- package/screenshot/getSearchByKey.png +0 -0
- package/screenshot/getSimilarSinger.png +0 -0
- package/screenshot/getSingerAlbum.png +0 -0
- package/screenshot/getSingerDesc.png +0 -0
- package/screenshot/getSingerHotsong.png +0 -0
- package/screenshot/getSingerList.png +0 -0
- package/screenshot/getSingerMv-default.png +0 -0
- package/screenshot/getSingerMv-listen.png +0 -0
- package/screenshot/getSingerMv-time.png +0 -0
- package/screenshot/getSingerStarNum.png +0 -0
- package/screenshot/getSmartbox.png +0 -0
- package/screenshot/getSongInfo.png +0 -0
- package/screenshot/getSongListCategories.png +0 -0
- package/screenshot/getSongListDetail.png +0 -0
- package/screenshot/getSongLists-params.png +0 -0
- package/screenshot/getSongLists.png +0 -0
- package/screenshot/getTicketInfo.png +0 -0
- package/screenshot/getTopLists.png +0 -0
- package/screenshot/gethotkey.png +0 -0
- package/screenshot/just-get-play-url.png +0 -0
- package/screenshot/musicPlay.png +0 -0
- package/screenshot/new-feature-error-tips.png +0 -0
- package/screenshot/normalize-cookie.png +0 -0
- package/screenshot/qq-music-v0.png +0 -0
- package/screenshot/qq-music.png +0 -0
- package/screenshot/song-image.png +0 -0
- package/screenshot/song-quality-128.png +0 -0
- package/screenshot/song-quality-m4a.png +0 -0
- package/scripts/build-images.js +36 -0
- package/scripts/commit-push.sh +103 -0
- package/util/colors.js +16 -0
- package/util/cookie.js +22 -0
- package/util/loginUtils.js +23 -0
- package/util/lyricParse.js +64 -0
- package/util/request.js +57 -0
- package/vercel.json +15 -0
package/.babelrc
ADDED
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.
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules/
|
package/.prettierrc
ADDED
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.
|
|
Binary file
|
|
Binary file
|
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
|
+
  
|
|
8
|
+
<br />
|
|
9
|
+

|
|
10
|
+
<br />
|
|
11
|
+
      
|
|
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
|
+

|
|
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
|
+
#### š¤ č“”ē® 
|
|
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')
|