@sansenjian/qq-music-api 2.2.1 → 2.2.9
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/CHANGELOG.md +124 -33
- package/README.md +2 -0
- package/dist/app.js +77 -0
- package/dist/config/service-config.js +37 -0
- package/dist/config/user-info.js +59 -0
- package/dist/index.js +3 -0
- package/dist/jest.config.js +52 -0
- package/dist/middlewares/fallback-middleware.js +29 -0
- package/dist/middlewares/koa-cors.js +63 -0
- package/dist/module/apis/UCommon/UCommon.js +10 -0
- package/dist/module/apis/album/getAlbumInfo.js +23 -0
- package/dist/module/apis/comments/getComments.js +24 -0
- package/dist/module/apis/digitalAlbum/getDigitalAlbumLists.js +22 -0
- package/dist/module/apis/downloadQQMusic.js +48 -0
- package/dist/module/apis/extend/getPlaylistTags.js +158 -0
- package/dist/module/apis/music/getLyric.js +32 -0
- package/dist/module/apis/music/getMusicPlay.js +187 -0
- package/dist/module/apis/mv/getMvByTag.js +23 -0
- package/dist/module/apis/radio/getRadioLists.js +26 -0
- package/dist/module/apis/rank/getTopLists.js +35 -0
- package/dist/module/apis/recommend/getDailyRecommend.js +124 -0
- package/dist/module/apis/recommend/getPersonalRecommend.js +114 -0
- package/dist/module/apis/search/getHotKey.js +25 -0
- package/dist/module/apis/search/getSearchByKey.js +32 -0
- package/dist/module/apis/search/getSmartbox.js +40 -0
- package/dist/module/apis/singers/getSimilarSinger.js +24 -0
- package/dist/module/apis/singers/getSingerDesc.js +24 -0
- package/dist/module/apis/singers/getSingerMv.js +23 -0
- package/dist/module/apis/singers/getSingerStarNum.js +23 -0
- package/dist/module/apis/songLists/songListCategories.js +23 -0
- package/dist/module/apis/songLists/songListDetail.js +28 -0
- package/dist/module/apis/songLists/songLists.js +35 -0
- package/dist/module/apis/u_common.js +62 -0
- package/dist/module/apis/user/checkQQLoginQr.js +189 -0
- package/dist/module/apis/user/getQQLoginQr.js +23 -0
- package/dist/module/apis/user/getUserAvatar.js +25 -0
- package/dist/module/apis/user/getUserLikedSongs.js +129 -0
- package/dist/module/apis/user/getUserPlaylists.js +138 -0
- package/dist/module/apis/y_common.js +69 -0
- package/dist/module/config.js +24 -0
- package/dist/module/index.js +72 -0
- package/dist/package.json +120 -0
- package/dist/routers/context/batchGetSongInfo.js +48 -0
- package/dist/routers/context/batchGetSongLists.js +35 -0
- package/dist/routers/context/checkQQLoginQr.js +16 -0
- package/dist/routers/context/cookies.js +36 -0
- package/dist/routers/context/getAlbumInfo.js +22 -0
- package/dist/routers/context/getComments.js +31 -0
- package/dist/routers/context/getDailyRecommend.js +33 -0
- package/dist/routers/context/getDigitalAlbumLists.js +16 -0
- package/dist/routers/context/getDownloadQQMusic.js +16 -0
- package/dist/routers/context/getHotkey.js +20 -0
- package/dist/routers/context/getImageUrl.js +25 -0
- package/dist/routers/context/getLyric.js +29 -0
- package/dist/routers/context/getMusicPlay.js +33 -0
- package/dist/routers/context/getMv.js +51 -0
- package/dist/routers/context/getMvByTag.js +16 -0
- package/dist/routers/context/getMvPlay.js +104 -0
- package/dist/routers/context/getNewDisks.js +52 -0
- package/dist/routers/context/getPersonalRecommend.js +42 -0
- package/dist/routers/context/getPlaylistTags.js +54 -0
- package/dist/routers/context/getQQLoginQr.js +14 -0
- package/dist/routers/context/getRadioLists.js +16 -0
- package/dist/routers/context/getRanks.js +53 -0
- package/dist/routers/context/getRecommend.js +88 -0
- package/dist/routers/context/getSearchByKey.js +32 -0
- package/dist/routers/context/getSimilarSinger.js +27 -0
- package/dist/routers/context/getSingerAlbum.js +48 -0
- package/dist/routers/context/getSingerDesc.js +28 -0
- package/dist/routers/context/getSingerHotsong.js +48 -0
- package/dist/routers/context/getSingerList.js +39 -0
- package/dist/routers/context/getSingerMv.js +36 -0
- package/dist/routers/context/getSingerStarNum.js +27 -0
- package/dist/routers/context/getSmartbox.js +27 -0
- package/dist/routers/context/getSongInfo.js +40 -0
- package/dist/routers/context/getSongListCategories.js +22 -0
- package/dist/routers/context/getSongListDetail.js +17 -0
- package/dist/routers/context/getSongLists.js +25 -0
- package/dist/routers/context/getTicketInfo.js +47 -0
- package/dist/routers/context/getTopLists.js +16 -0
- package/dist/routers/context/getUserAvatar.js +35 -0
- package/dist/routers/context/getUserLikedSongs.js +24 -0
- package/dist/routers/context/getUserPlaylists.js +27 -0
- package/dist/routers/context/index.js +98 -0
- package/dist/routers/router.js +69 -0
- package/dist/routers/types.js +2 -0
- package/dist/routers/util.js +219 -0
- package/dist/scripts/run-tests-with-flags.js +139 -0
- package/dist/types/api.js +55 -0
- package/dist/util/apiResponse.js +88 -0
- package/dist/util/colors.js +19 -0
- package/dist/util/cookie.js +34 -0
- package/dist/util/cookieResolver.js +66 -0
- package/dist/util/loginUtils.js +30 -0
- package/dist/util/lyricParse.js +72 -0
- package/dist/util/request.js +118 -0
- package/docs-dist/404.html +24 -0
- package/docs-dist/CHANGELOG-ARCHITECTURE.html +131 -0
- package/docs-dist/COOKIE_CONFIG_GUIDE.html +39 -0
- package/docs-dist/FALLBACK_MODE_GUIDE.html +101 -0
- package/docs-dist/README.html +447 -0
- package/docs-dist/TEST_USER_PLAYLISTS.html +42 -0
- package/docs-dist/USER_AVATAR_GUIDE.html +100 -0
- package/docs-dist/api/comments.html +48 -0
- package/docs-dist/api/index.html +27 -0
- package/docs-dist/api/music.html +51 -0
- package/docs-dist/api/other.html +33 -0
- package/docs-dist/api/playlist.html +77 -0
- package/docs-dist/api/rank.html +48 -0
- package/docs-dist/api/search.html +62 -0
- package/docs-dist/api/singer.html +47 -0
- package/docs-dist/api/user.html +64 -0
- package/docs-dist/assets/CHANGELOG-ARCHITECTURE.md.r40JGJZK.js +105 -0
- package/docs-dist/assets/CHANGELOG-ARCHITECTURE.md.r40JGJZK.lean.js +1 -0
- package/docs-dist/assets/COOKIE_CONFIG_GUIDE.md.BVXl7WHu.js +13 -0
- package/docs-dist/assets/COOKIE_CONFIG_GUIDE.md.BVXl7WHu.lean.js +1 -0
- package/docs-dist/assets/FALLBACK_MODE_GUIDE.md.BBdcIdh_.js +75 -0
- package/docs-dist/assets/FALLBACK_MODE_GUIDE.md.BBdcIdh_.lean.js +1 -0
- package/docs-dist/assets/README.md.D6Tw0nRd.js +421 -0
- package/docs-dist/assets/README.md.D6Tw0nRd.lean.js +1 -0
- package/docs-dist/assets/TEST_USER_PLAYLISTS.md.DSt20Igj.js +16 -0
- package/docs-dist/assets/TEST_USER_PLAYLISTS.md.DSt20Igj.lean.js +1 -0
- package/docs-dist/assets/USER_AVATAR_GUIDE.md.CVHPs2Dn.js +74 -0
- package/docs-dist/assets/USER_AVATAR_GUIDE.md.CVHPs2Dn.lean.js +1 -0
- package/docs-dist/assets/api_comments.md.79Q_C8Qp.js +22 -0
- package/docs-dist/assets/api_comments.md.79Q_C8Qp.lean.js +1 -0
- package/docs-dist/assets/api_index.md.CU3By8tw.js +1 -0
- package/docs-dist/assets/api_index.md.CU3By8tw.lean.js +1 -0
- package/docs-dist/assets/api_music.md.B1AzLePX.js +25 -0
- package/docs-dist/assets/api_music.md.B1AzLePX.lean.js +1 -0
- package/docs-dist/assets/api_other.md.DCg4bzA7.js +7 -0
- package/docs-dist/assets/api_other.md.DCg4bzA7.lean.js +1 -0
- package/docs-dist/assets/api_playlist.md.8ACJ3QqD.js +51 -0
- package/docs-dist/assets/api_playlist.md.8ACJ3QqD.lean.js +1 -0
- package/docs-dist/assets/api_rank.md.B8IP2ZRy.js +22 -0
- package/docs-dist/assets/api_rank.md.B8IP2ZRy.lean.js +1 -0
- package/docs-dist/assets/api_search.md.DO9J6nvp.js +36 -0
- package/docs-dist/assets/api_search.md.DO9J6nvp.lean.js +1 -0
- package/docs-dist/assets/api_singer.md.CcL32xuN.js +21 -0
- package/docs-dist/assets/api_singer.md.CcL32xuN.lean.js +1 -0
- package/docs-dist/assets/api_user.md.Cb7Ky3Sn.js +38 -0
- package/docs-dist/assets/api_user.md.Cb7Ky3Sn.lean.js +1 -0
- package/docs-dist/assets/app.CSainqD9.js +1 -0
- package/docs-dist/assets/chunks/@localSearchIndexroot.BKleDIv-.js +1 -0
- package/docs-dist/assets/chunks/VPLocalSearchBox.BUBaq7tw.js +9 -0
- package/docs-dist/assets/chunks/framework.aJbMEiY9.js +19 -0
- package/docs-dist/assets/chunks/theme.CzMhU0Ps.js +2 -0
- package/docs-dist/assets/guide_architecture.md.CzgqynmB.js +258 -0
- package/docs-dist/assets/guide_architecture.md.CzgqynmB.lean.js +1 -0
- package/docs-dist/assets/guide_authentication.md.a8yTA8Xe.js +4 -0
- package/docs-dist/assets/guide_authentication.md.a8yTA8Xe.lean.js +1 -0
- package/docs-dist/assets/guide_index.md.BgUUL6fI.js +1 -0
- package/docs-dist/assets/guide_index.md.BgUUL6fI.lean.js +1 -0
- package/docs-dist/assets/guide_installation.md.BCZ4jBl_.js +7 -0
- package/docs-dist/assets/guide_installation.md.BCZ4jBl_.lean.js +1 -0
- package/docs-dist/assets/guide_quickstart.md.9-4dA6wS.js +13 -0
- package/docs-dist/assets/guide_quickstart.md.9-4dA6wS.lean.js +1 -0
- package/docs-dist/assets/index.md.z0hAJioN.js +1 -0
- package/docs-dist/assets/index.md.z0hAJioN.lean.js +1 -0
- package/docs-dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/docs-dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/docs-dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/docs-dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/docs-dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/docs-dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/docs-dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/docs-dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/docs-dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/docs-dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/docs-dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/docs-dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/docs-dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/docs-dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/docs-dist/assets/reference_response-format.md.VvQTLDZr.js +12 -0
- package/docs-dist/assets/reference_response-format.md.VvQTLDZr.lean.js +1 -0
- package/docs-dist/assets/style.DM4qKDd4.css +1 -0
- package/docs-dist/guide/architecture.html +284 -0
- package/docs-dist/guide/authentication.html +30 -0
- package/docs-dist/guide/index.html +27 -0
- package/docs-dist/guide/installation.html +33 -0
- package/docs-dist/guide/quickstart.html +39 -0
- package/docs-dist/hashmap.json +1 -0
- package/docs-dist/index.html +27 -0
- package/docs-dist/logo.svg +4 -0
- package/docs-dist/reference/response-format.html +38 -0
- package/docs-dist/version.json +7 -0
- package/docs-dist/vp-icons.css +1 -0
- package/package.json +31 -17
- package/.babelrc +0 -7
- package/.dockerignore +0 -5
- package/.editorconfig +0 -31
- package/.eslintrc.json +0 -22
- package/.github/workflows/deploy-docs.yml +0 -54
- package/.github/workflows/release.yml +0 -37
- package/.github/workflows/test.yml +0 -70
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -1
- package/.prettierrc +0 -9
- package/AGENTS.md +0 -153
- package/Dockerfile +0 -18
- 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/app.ts +0 -68
- package/commitlint.config.js +0 -20
- package/config/user-info.ts +0 -71
- package/index.ts +0 -1
- package/jest.config.ts +0 -41
- package/middlewares/koa-cors.ts +0 -81
- package/module/apis/UCommon/UCommon.ts +0 -13
- package/module/apis/album/getAlbumInfo.ts +0 -22
- package/module/apis/comments/getComments.ts +0 -23
- package/module/apis/digitalAlbum/getDigitalAlbumLists.ts +0 -23
- package/module/apis/downloadQQMusic.ts +0 -51
- package/module/apis/music/getLyric.ts +0 -34
- package/module/apis/mv/getMvByTag.ts +0 -24
- package/module/apis/radio/getRadioLists.ts +0 -27
- package/module/apis/rank/getTopLists.ts +0 -37
- package/module/apis/search/getHotKey.ts +0 -24
- package/module/apis/search/getSearchByKey.ts +0 -31
- package/module/apis/search/getSmartbox.ts +0 -43
- package/module/apis/singers/getSimilarSinger.ts +0 -25
- package/module/apis/singers/getSingerDesc.ts +0 -25
- package/module/apis/singers/getSingerMv.ts +0 -24
- package/module/apis/singers/getSingerStarNum.ts +0 -24
- package/module/apis/songLists/songListCategories.ts +0 -22
- package/module/apis/songLists/songListDetail.ts +0 -27
- package/module/apis/songLists/songLists.ts +0 -35
- package/module/apis/u_common.ts +0 -29
- package/module/apis/user/checkQQLoginQr.ts +0 -230
- package/module/apis/user/getQQLoginQr.ts +0 -28
- package/module/apis/user/getUserAvatar.ts +0 -32
- package/module/apis/user/getUserLikedSongs.ts +0 -145
- package/module/apis/user/getUserPlaylists.ts +0 -163
- package/module/apis/y_common.ts +0 -44
- package/module/config.ts +0 -24
- package/module/index.ts +0 -95
- package/music.png +0 -0
- package/pnpm-workspace.yaml +0 -2
- package/public/index.html +0 -430
- package/routers/context/batchGetSongInfo.ts +0 -60
- package/routers/context/batchGetSongLists.ts +0 -46
- package/routers/context/checkQQLoginQr.ts +0 -19
- package/routers/context/cookies.ts +0 -38
- package/routers/context/getAlbumInfo.ts +0 -31
- package/routers/context/getComments.ts +0 -51
- package/routers/context/getDigitalAlbumLists.ts +0 -18
- package/routers/context/getDownloadQQMusic.ts +0 -17
- package/routers/context/getHotkey.ts +0 -25
- package/routers/context/getImageUrl.ts +0 -29
- package/routers/context/getLyric.ts +0 -32
- package/routers/context/getMusicPlay.ts +0 -102
- package/routers/context/getMv.ts +0 -61
- package/routers/context/getMvByTag.ts +0 -18
- package/routers/context/getMvPlay.ts +0 -114
- package/routers/context/getNewDisks.ts +0 -58
- package/routers/context/getQQLoginQr.ts +0 -16
- package/routers/context/getRadioLists.ts +0 -18
- package/routers/context/getRanks.ts +0 -67
- package/routers/context/getRecommend.ts +0 -92
- package/routers/context/getSearchByKey.ts +0 -34
- package/routers/context/getSimilarSinger.ts +0 -29
- package/routers/context/getSingerAlbum.ts +0 -58
- package/routers/context/getSingerDesc.ts +0 -30
- package/routers/context/getSingerHotsong.ts +0 -58
- package/routers/context/getSingerList.ts +0 -56
- package/routers/context/getSingerMv.ts +0 -41
- package/routers/context/getSingerStarNum.ts +0 -29
- package/routers/context/getSmartbox.ts +0 -27
- package/routers/context/getSongInfo.ts +0 -51
- package/routers/context/getSongListCategories.ts +0 -23
- package/routers/context/getSongListDetail.ts +0 -22
- package/routers/context/getSongLists.ts +0 -30
- package/routers/context/getTicketInfo.ts +0 -51
- package/routers/context/getTopLists.ts +0 -18
- package/routers/context/getUserAvatar.ts +0 -53
- package/routers/context/getUserLikedSongs.ts +0 -28
- package/routers/context/getUserPlaylists.ts +0 -29
- package/routers/context/index.ts +0 -87
- package/routers/router.ts +0 -88
- package/routers/types.ts +0 -18
- package/routers/util.ts +0 -231
- 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 +0 -36
- package/scripts/commit-push.sh +0 -103
- package/tests/integration/api/api.test.ts +0 -852
- package/tests/integration/middleware/cors.test.ts +0 -41
- package/tests/setup/jest.setup.ts +0 -15
- package/tests/setup/testUtils.ts +0 -35
- package/tests/unit/util/request.test.ts +0 -177
- package/tsconfig.json +0 -20
- package/tsconfig.test.json +0 -8
- package/types/api.ts +0 -105
- package/types/global.d.ts +0 -26
- package/types/index.d.ts +0 -97
- package/util/apiResponse.ts +0 -97
- package/util/colors.ts +0 -31
- package/util/cookie.ts +0 -40
- package/util/loginUtils.ts +0 -26
- package/util/lyricParse.ts +0 -86
- package/util/request.ts +0 -141
- package/vercel.json +0 -15
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Context, Next } from 'koa';
|
|
2
|
-
import { downloadQQMusic } from '../../module';
|
|
3
|
-
import type { ApiResponse } from '../../types/api';
|
|
4
|
-
|
|
5
|
-
export default async (ctx: Context, next: Next) => {
|
|
6
|
-
const props = {
|
|
7
|
-
method: 'get',
|
|
8
|
-
params: {},
|
|
9
|
-
option: {}
|
|
10
|
-
};
|
|
11
|
-
const result = await downloadQQMusic(props) as ApiResponse;
|
|
12
|
-
const { status, body } = result;
|
|
13
|
-
Object.assign(ctx, {
|
|
14
|
-
status,
|
|
15
|
-
body
|
|
16
|
-
});
|
|
17
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Context, Next } from 'koa';
|
|
2
|
-
import { getHotKey } from '../../module';
|
|
3
|
-
|
|
4
|
-
export default async (ctx: Context, next: Next) => {
|
|
5
|
-
const props = {
|
|
6
|
-
method: 'get',
|
|
7
|
-
params: {},
|
|
8
|
-
option: {}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
if (process.env.DEBUG === 'true') {
|
|
12
|
-
console.log('[getHotkey] controller props:', props);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const { status, body } = await getHotKey(props);
|
|
16
|
-
|
|
17
|
-
if (process.env.DEBUG === 'true') {
|
|
18
|
-
console.log('[getHotkey] controller response status:', status);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
Object.assign(ctx, {
|
|
22
|
-
status,
|
|
23
|
-
body
|
|
24
|
-
});
|
|
25
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
|
|
3
|
-
const controller: Controller = async (ctx, next) => {
|
|
4
|
-
const { id, size = '300x300', maxAge = 2592000 } = ctx.query;
|
|
5
|
-
|
|
6
|
-
if (!id) {
|
|
7
|
-
ctx.status = 400;
|
|
8
|
-
ctx.body = {
|
|
9
|
-
response: 'no id~~'
|
|
10
|
-
};
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const body = {
|
|
15
|
-
response: {
|
|
16
|
-
code: 0,
|
|
17
|
-
data: {
|
|
18
|
-
imageUrl: `https://y.gtimg.cn/music/photo_new/T002R${size}M000${id}.jpg?max_age=${maxAge}`
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
Object.assign(ctx, {
|
|
24
|
-
status: 200,
|
|
25
|
-
body
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default controller;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { getLyric } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const songmid = Array.isArray(ctx.query.songmid) ? ctx.query.songmid[0] : ctx.query.songmid;
|
|
6
|
-
const rawIsFormat = Array.isArray(ctx.query.isFormat) ? ctx.query.isFormat[0] : ctx.query.isFormat;
|
|
7
|
-
|
|
8
|
-
const props = {
|
|
9
|
-
method: 'get',
|
|
10
|
-
params: {
|
|
11
|
-
songmid
|
|
12
|
-
},
|
|
13
|
-
option: {},
|
|
14
|
-
isFormat: rawIsFormat
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
if (songmid) {
|
|
18
|
-
const { status, body } = await getLyric(props);
|
|
19
|
-
Object.assign(ctx, {
|
|
20
|
-
status,
|
|
21
|
-
body
|
|
22
|
-
});
|
|
23
|
-
} else {
|
|
24
|
-
ctx.status = 400;
|
|
25
|
-
ctx.body = {
|
|
26
|
-
response: 'no songmid'
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default controller;
|
|
32
|
-
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { UCommon } from '../../module';
|
|
3
|
-
import { _guid } from '../../module/config';
|
|
4
|
-
|
|
5
|
-
const ALLOWED_QUALITIES = ['m4a', 128, 320, 'ape', 'flac'];
|
|
6
|
-
const DEFAULT_QUALITY = 128;
|
|
7
|
-
|
|
8
|
-
const parseQuality = (quality: any): string | number => {
|
|
9
|
-
const parsed = parseInt(quality) || quality;
|
|
10
|
-
return ALLOWED_QUALITIES.includes(parsed) ? parsed : DEFAULT_QUALITY;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const controller: Controller = async (ctx, next) => {
|
|
14
|
-
const uin = (global as any).userInfo?.uin || '0';
|
|
15
|
-
const songmid = ctx.query.songmid + '';
|
|
16
|
-
const justPlayUrl = (ctx.query.resType || 'play') === 'play';
|
|
17
|
-
const guid = _guid || '1429839143';
|
|
18
|
-
const { mediaId } = ctx.query;
|
|
19
|
-
const quality = parseQuality(ctx.query.quality);
|
|
20
|
-
|
|
21
|
-
const fileType: Record<string, { s: string; e: string }> = {
|
|
22
|
-
m4a: { s: 'C400', e: '.m4a' },
|
|
23
|
-
128: { s: 'M500', e: '.mp3' },
|
|
24
|
-
320: { s: 'M800', e: '.mp3' },
|
|
25
|
-
ape: { s: 'A000', e: '.ape' },
|
|
26
|
-
flac: { s: 'F000', e: '.flac' }
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const songmidList = songmid.split(',');
|
|
30
|
-
const fileInfo = fileType[quality as string];
|
|
31
|
-
const file = songmidList.map(_ => `${fileInfo.s}${_}${mediaId || _}${fileInfo.e}`);
|
|
32
|
-
|
|
33
|
-
const data = {
|
|
34
|
-
req_0: {
|
|
35
|
-
module: 'vkey.GetVkeyServer',
|
|
36
|
-
method: 'CgiGetVkey',
|
|
37
|
-
param: {
|
|
38
|
-
filename: file,
|
|
39
|
-
guid,
|
|
40
|
-
songmid: songmidList,
|
|
41
|
-
songtype: [0],
|
|
42
|
-
uin,
|
|
43
|
-
loginflag: 1,
|
|
44
|
-
platform: '20'
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
loginUin: uin,
|
|
48
|
-
comm: {
|
|
49
|
-
uin,
|
|
50
|
-
format: 'json',
|
|
51
|
-
ct: 24,
|
|
52
|
-
cv: 0
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const params = Object.assign({
|
|
57
|
-
format: 'json',
|
|
58
|
-
sign: 'zzannc1o6o9b4i971602f3554385022046ab796512b7012',
|
|
59
|
-
data: JSON.stringify(data)
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const props = {
|
|
63
|
-
method: 'get',
|
|
64
|
-
params,
|
|
65
|
-
option: {}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
if (songmid) {
|
|
69
|
-
await UCommon(props)
|
|
70
|
-
.then(res => {
|
|
71
|
-
const response = res.data;
|
|
72
|
-
const domain =
|
|
73
|
-
response?.req_0?.data?.sip?.filter?.((i: string) => !i.startsWith('http://ws'))?.[0] ||
|
|
74
|
-
response?.req_0?.data?.sip?.[0];
|
|
75
|
-
|
|
76
|
-
const playUrl: Record<string, { url: string; error?: string }> = {};
|
|
77
|
-
(response?.req_0?.data?.midurlinfo || []).forEach((item: any) => {
|
|
78
|
-
playUrl[item.songmid] = {
|
|
79
|
-
url: item.purl ? `${domain}${item.purl}` : '',
|
|
80
|
-
error: !item.purl ? '暂无播放链接' : undefined
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
response.playUrl = playUrl;
|
|
85
|
-
ctx.body = {
|
|
86
|
-
data: justPlayUrl ? { playUrl } : response
|
|
87
|
-
};
|
|
88
|
-
})
|
|
89
|
-
.catch(error => {
|
|
90
|
-
console.log('error', error);
|
|
91
|
-
});
|
|
92
|
-
} else {
|
|
93
|
-
ctx.status = 400;
|
|
94
|
-
ctx.body = {
|
|
95
|
-
data: {
|
|
96
|
-
message: 'no songmid'
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export default controller;
|
package/routers/context/getMv.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { UCommon } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const { area_id = 15, version_id = 7, limit = 20, page = 0 } = ctx.query;
|
|
6
|
-
const start = (+page ? +page - 1 : 0) * +limit;
|
|
7
|
-
|
|
8
|
-
const data = {
|
|
9
|
-
comm: {
|
|
10
|
-
ct: 24
|
|
11
|
-
},
|
|
12
|
-
mv_tag: {
|
|
13
|
-
module: 'MvService.MvInfoProServer',
|
|
14
|
-
method: 'GetAllocTag',
|
|
15
|
-
param: {}
|
|
16
|
-
},
|
|
17
|
-
mv_list: {
|
|
18
|
-
module: 'MvService.MvInfoProServer',
|
|
19
|
-
method: 'GetAllocMvInfo',
|
|
20
|
-
param: {
|
|
21
|
-
start,
|
|
22
|
-
limit: +limit,
|
|
23
|
-
version_id,
|
|
24
|
-
area_id,
|
|
25
|
-
order: 1
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const params = Object.assign({
|
|
31
|
-
format: 'json',
|
|
32
|
-
data: JSON.stringify(data)
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const props = {
|
|
36
|
-
method: 'get',
|
|
37
|
-
params,
|
|
38
|
-
option: {}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
if (version_id && area_id) {
|
|
42
|
-
await UCommon(props)
|
|
43
|
-
.then(res => {
|
|
44
|
-
const response = res.data;
|
|
45
|
-
ctx.status = 200;
|
|
46
|
-
ctx.body = {
|
|
47
|
-
response
|
|
48
|
-
};
|
|
49
|
-
})
|
|
50
|
-
.catch(error => {
|
|
51
|
-
console.log('error', error);
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
ctx.status = 400;
|
|
55
|
-
ctx.body = {
|
|
56
|
-
response: 'version_id or area_id is null'
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default controller;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { getMvByTag } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const props = {
|
|
6
|
-
method: 'get',
|
|
7
|
-
params: {},
|
|
8
|
-
option: {}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const { status, body } = await getMvByTag(props);
|
|
12
|
-
Object.assign(ctx, {
|
|
13
|
-
status,
|
|
14
|
-
body
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default controller;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { UCommon } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const { vid } = ctx.query;
|
|
6
|
-
|
|
7
|
-
const data = {
|
|
8
|
-
comm: {
|
|
9
|
-
ct: 24,
|
|
10
|
-
cv: 4747474
|
|
11
|
-
},
|
|
12
|
-
getMVUrl: {
|
|
13
|
-
module: 'gosrf.Stream.MvUrlProxy',
|
|
14
|
-
method: 'GetMvUrls',
|
|
15
|
-
param: {
|
|
16
|
-
vids: [vid],
|
|
17
|
-
request_typet: 10001
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
mvinfo: {
|
|
21
|
-
module: 'video.VideoDataServer',
|
|
22
|
-
method: 'get_video_info_batch',
|
|
23
|
-
param: {
|
|
24
|
-
vidlist: [vid],
|
|
25
|
-
required: [
|
|
26
|
-
'vid', 'type', 'sid', 'cover_pic', 'duration', 'singers',
|
|
27
|
-
'video_switch', 'msg', 'name', 'desc', 'playcnt', 'pubdate',
|
|
28
|
-
'isfav', 'gmid'
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
other: {
|
|
33
|
-
module: 'video.VideoLogicServer',
|
|
34
|
-
method: 'rec_video_byvid',
|
|
35
|
-
param: {
|
|
36
|
-
vid,
|
|
37
|
-
required: [
|
|
38
|
-
'vid', 'type', 'sid', 'cover_pic', 'duration', 'singers',
|
|
39
|
-
'video_switch', 'msg', 'name', 'desc', 'playcnt', 'pubdate',
|
|
40
|
-
'isfav', 'gmid', 'uploader_headurl', 'uploader_nick',
|
|
41
|
-
'uploader_encuin', 'uploader_uin', 'uploader_hasfollow',
|
|
42
|
-
'uploader_follower_num'
|
|
43
|
-
],
|
|
44
|
-
support: 1
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const params = Object.assign({
|
|
50
|
-
format: 'json',
|
|
51
|
-
data: JSON.stringify(data)
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const props = {
|
|
55
|
-
method: 'get',
|
|
56
|
-
params,
|
|
57
|
-
option: {}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
if (vid) {
|
|
61
|
-
await UCommon(props)
|
|
62
|
-
.then(res => {
|
|
63
|
-
const response = res.data;
|
|
64
|
-
const mvurls = response?.getMVUrl?.data;
|
|
65
|
-
|
|
66
|
-
if (!mvurls || typeof mvurls !== 'object' || Object.keys(mvurls).length === 0) {
|
|
67
|
-
ctx.status = 502;
|
|
68
|
-
ctx.body = {
|
|
69
|
-
response: {
|
|
70
|
-
data: null,
|
|
71
|
-
error: 'Failed to get MV URL data'
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const mvurlskey = Object.keys(mvurls)[0];
|
|
78
|
-
const mp4_urls = mvurls[mvurlskey]?.mp4?.map((item: any) => item.freeflow_url) || [];
|
|
79
|
-
const hls_urls = mvurls[mvurlskey]?.hls?.map((item: any) => item.freeflow_url) || [];
|
|
80
|
-
const urls = [...mp4_urls, ...hls_urls];
|
|
81
|
-
|
|
82
|
-
let play_urls: string[] = [];
|
|
83
|
-
let playLists: Record<string, string[]> = {};
|
|
84
|
-
|
|
85
|
-
if (urls.length) {
|
|
86
|
-
urls.forEach((url: string[]) => {
|
|
87
|
-
play_urls = [...play_urls, ...url];
|
|
88
|
-
});
|
|
89
|
-
playLists = {
|
|
90
|
-
f10: play_urls.filter((item: string) => /\.f10\.mp4/.test(item)),
|
|
91
|
-
f20: play_urls.filter((item: string) => /\.f20\.mp4/.test(item)),
|
|
92
|
-
f30: play_urls.filter((item: string) => /\.f30\.mp4/.test(item)),
|
|
93
|
-
f40: play_urls.filter((item: string) => /\.f40\.mp4/.test(item))
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
response.playLists = playLists;
|
|
98
|
-
ctx.status = 200;
|
|
99
|
-
ctx.body = {
|
|
100
|
-
response
|
|
101
|
-
};
|
|
102
|
-
})
|
|
103
|
-
.catch(error => {
|
|
104
|
-
console.log('error', error);
|
|
105
|
-
});
|
|
106
|
-
} else {
|
|
107
|
-
ctx.status = 400;
|
|
108
|
-
ctx.body = {
|
|
109
|
-
response: 'vid is null'
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export default controller;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { UCommon } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const page = +ctx.query.page || 1;
|
|
6
|
-
const num = +ctx.query.limit || 20;
|
|
7
|
-
const start = (page - 1) * num;
|
|
8
|
-
|
|
9
|
-
const data: any = {
|
|
10
|
-
new_album: {
|
|
11
|
-
module: 'newalbum.NewAlbumServer',
|
|
12
|
-
method: 'get_new_album_info',
|
|
13
|
-
param: {
|
|
14
|
-
area: 1,
|
|
15
|
-
start,
|
|
16
|
-
num
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
comm: {
|
|
20
|
-
ct: 24,
|
|
21
|
-
cv: 0
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
if (!start) {
|
|
26
|
-
data.new_album_tag = {
|
|
27
|
-
module: 'newalbum.NewAlbumServer',
|
|
28
|
-
method: 'get_new_album_area',
|
|
29
|
-
param: {}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const params = Object.assign({
|
|
34
|
-
format: 'json',
|
|
35
|
-
data: JSON.stringify(data)
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const props = {
|
|
39
|
-
method: 'get',
|
|
40
|
-
params,
|
|
41
|
-
option: {}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
await UCommon(props)
|
|
45
|
-
.then(res => {
|
|
46
|
-
const response = res.data;
|
|
47
|
-
ctx.status = 200;
|
|
48
|
-
ctx.body = {
|
|
49
|
-
status: 200,
|
|
50
|
-
response
|
|
51
|
-
};
|
|
52
|
-
})
|
|
53
|
-
.catch(error => {
|
|
54
|
-
console.log('error', error);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default controller;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { getQQLoginQr } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const props = {
|
|
6
|
-
method: 'get'
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const { status, body } = await getQQLoginQr(props);
|
|
10
|
-
Object.assign(ctx, {
|
|
11
|
-
status,
|
|
12
|
-
body
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default controller;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { getRadioLists } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const props = {
|
|
6
|
-
method: 'get',
|
|
7
|
-
params: {},
|
|
8
|
-
option: {}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const { status, body } = await getRadioLists(props);
|
|
12
|
-
Object.assign(ctx, {
|
|
13
|
-
status,
|
|
14
|
-
body
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default controller;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { UCommon } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const getWeekNumber = (d: Date): number => {
|
|
6
|
-
d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
|
|
7
|
-
const dayNum = d.getUTCDay() || 7;
|
|
8
|
-
d.setUTCDate(d.getUTCDate() + 4 - dayNum);
|
|
9
|
-
const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
|
|
10
|
-
return Math.ceil((((d.getTime() - yearStart.getTime()) / 86400000) + 1) / 7);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const topId = +ctx.query.topId || 4;
|
|
14
|
-
const num = +ctx.query.limit || 20;
|
|
15
|
-
const offset = +ctx.query.page || 0;
|
|
16
|
-
|
|
17
|
-
let date = new Date();
|
|
18
|
-
const week = getWeekNumber(date);
|
|
19
|
-
const isoWeekYearVal = date.getFullYear();
|
|
20
|
-
const period = `${isoWeekYearVal}_${week}`;
|
|
21
|
-
|
|
22
|
-
const data = {
|
|
23
|
-
comm: {
|
|
24
|
-
ct: 24,
|
|
25
|
-
cv: 4747474,
|
|
26
|
-
format: 'json',
|
|
27
|
-
inCharset: 'utf-8',
|
|
28
|
-
needNewCode: 1,
|
|
29
|
-
uin: 0
|
|
30
|
-
},
|
|
31
|
-
req_1: {
|
|
32
|
-
module: 'musicToplist.ToplistInfoServer',
|
|
33
|
-
method: 'GetDetail',
|
|
34
|
-
param: {
|
|
35
|
-
topId,
|
|
36
|
-
offset,
|
|
37
|
-
num,
|
|
38
|
-
period
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const params = Object.assign({
|
|
44
|
-
format: 'json',
|
|
45
|
-
data: JSON.stringify(data)
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const props = {
|
|
49
|
-
method: 'get',
|
|
50
|
-
params,
|
|
51
|
-
option: {}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
await UCommon(props)
|
|
55
|
-
.then(res => {
|
|
56
|
-
const response = res.data;
|
|
57
|
-
ctx.status = 200;
|
|
58
|
-
ctx.body = {
|
|
59
|
-
response
|
|
60
|
-
};
|
|
61
|
-
})
|
|
62
|
-
.catch(error => {
|
|
63
|
-
console.log('error', error);
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default controller;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { UCommon } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const data = {
|
|
6
|
-
comm: {
|
|
7
|
-
ct: 24
|
|
8
|
-
},
|
|
9
|
-
category: {
|
|
10
|
-
method: 'get_hot_category',
|
|
11
|
-
param: {
|
|
12
|
-
qq: ''
|
|
13
|
-
},
|
|
14
|
-
module: 'music.web_category_svr'
|
|
15
|
-
},
|
|
16
|
-
recomPlaylist: {
|
|
17
|
-
method: 'get_hot_recommend',
|
|
18
|
-
param: {
|
|
19
|
-
async: 1,
|
|
20
|
-
cmd: 2
|
|
21
|
-
},
|
|
22
|
-
module: 'playlist.HotRecommendServer'
|
|
23
|
-
},
|
|
24
|
-
playlist: {
|
|
25
|
-
method: 'get_playlist_by_category',
|
|
26
|
-
param: {
|
|
27
|
-
id: 8,
|
|
28
|
-
curPage: 1,
|
|
29
|
-
size: 40,
|
|
30
|
-
order: 5,
|
|
31
|
-
titleid: 8
|
|
32
|
-
},
|
|
33
|
-
module: 'playlist.PlayListPlazaServer'
|
|
34
|
-
},
|
|
35
|
-
new_song: {
|
|
36
|
-
module: 'newsong.NewSongServer',
|
|
37
|
-
method: 'get_new_song_info',
|
|
38
|
-
param: {
|
|
39
|
-
type: 5
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
new_album: {
|
|
43
|
-
module: 'newalbum.NewAlbumServer',
|
|
44
|
-
method: 'get_new_album_info',
|
|
45
|
-
param: {
|
|
46
|
-
area: 1,
|
|
47
|
-
sin: 0,
|
|
48
|
-
num: 10
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
new_album_tag: {
|
|
52
|
-
module: 'newalbum.NewAlbumServer',
|
|
53
|
-
method: 'get_new_album_area',
|
|
54
|
-
param: {}
|
|
55
|
-
},
|
|
56
|
-
toplist: {
|
|
57
|
-
module: 'musicToplist.ToplistInfoServer',
|
|
58
|
-
method: 'GetAll',
|
|
59
|
-
param: {}
|
|
60
|
-
},
|
|
61
|
-
focus: {
|
|
62
|
-
module: 'QQMusic.MusichallServer',
|
|
63
|
-
method: 'GetFocus',
|
|
64
|
-
param: {}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const params = Object.assign({
|
|
69
|
-
format: 'json',
|
|
70
|
-
data: JSON.stringify(data)
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const props = {
|
|
74
|
-
method: 'get',
|
|
75
|
-
params,
|
|
76
|
-
option: {}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
await UCommon(props)
|
|
80
|
-
.then(res => {
|
|
81
|
-
const response = res.data;
|
|
82
|
-
ctx.status = 200;
|
|
83
|
-
ctx.body = {
|
|
84
|
-
response
|
|
85
|
-
};
|
|
86
|
-
})
|
|
87
|
-
.catch(error => {
|
|
88
|
-
console.log('error', error);
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export default controller;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { KoaContext, Controller } from '../types';
|
|
2
|
-
import { getSearchByKey } from '../../module';
|
|
3
|
-
|
|
4
|
-
const controller: Controller = async (ctx, next) => {
|
|
5
|
-
const w = ctx.query.key || ctx.params.key;
|
|
6
|
-
const { limit: n, page: p, catZhida, remoteplace = 'song' } = ctx.query;
|
|
7
|
-
|
|
8
|
-
const props = {
|
|
9
|
-
method: 'get',
|
|
10
|
-
params: {
|
|
11
|
-
w,
|
|
12
|
-
n: +n || 10,
|
|
13
|
-
p: +p || 1,
|
|
14
|
-
catZhida: +catZhida || 1,
|
|
15
|
-
remoteplace: `txt.yqq.${remoteplace}`
|
|
16
|
-
},
|
|
17
|
-
option: {}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
if (w) {
|
|
21
|
-
const { status, body } = await getSearchByKey(props);
|
|
22
|
-
Object.assign(ctx, {
|
|
23
|
-
status,
|
|
24
|
-
body
|
|
25
|
-
});
|
|
26
|
-
} else {
|
|
27
|
-
ctx.status = 400;
|
|
28
|
-
ctx.body = {
|
|
29
|
-
response: 'search key is null'
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default controller;
|