diff --git a/.gitignore b/.gitignore index 39c7fa3410f..1083a12c1f2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ node_modules .idea/ package-lock.json +yarn.lock .vscode \ No newline at end of file diff --git a/module/activate_init_profile.js b/module/activate_init_profile.js index c9b5c3a276b..a83657096c0 100644 --- a/module/activate_init_profile.js +++ b/module/activate_init_profile.js @@ -2,8 +2,8 @@ module.exports = (query, request) => { const data = { - nickname: query.nickname - }; + nickname: query.nickname, + } return request( 'POST', `http://music.163.com/eapi/activate/initProfile`, @@ -12,7 +12,8 @@ module.exports = (query, request) => { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/activate/initProfile' + realIP: query.realIP, + url: '/api/activate/initProfile', } - ); -}; + ) +} diff --git a/module/album.js b/module/album.js index 213d92a2774..318e50ee282 100644 --- a/module/album.js +++ b/module/album.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/v1/album/${query.id}`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/album/${query.id}`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/album_detail.js b/module/album_detail.js index 053cd62f19c..d499b13ef1a 100644 --- a/module/album_detail.js +++ b/module/album_detail.js @@ -1,14 +1,17 @@ // 数字专辑详情 module.exports = (query, request) => { const data = { - id: query.id + id: query.id, } return request( - 'POST', `https://music.163.com/weapi/vipmall/albumproduct/detail`, data, + 'POST', + `https://music.163.com/weapi/vipmall/albumproduct/detail`, + data, { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy, + realIP: query.realIP, } ) -} \ No newline at end of file +} diff --git a/module/album_detail_dynamic.js b/module/album_detail_dynamic.js index a48386a78c5..ede2f00a571 100644 --- a/module/album_detail_dynamic.js +++ b/module/album_detail_dynamic.js @@ -1,12 +1,17 @@ // 专辑动态信息 module.exports = (query, request) => { const data = { - id: query.id + id: query.id, } return request( 'POST', `https://music.163.com/api/album/detail/dynamic`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/album_list.js b/module/album_list.js index a2d998cc5c1..3f44174dbe2 100644 --- a/module/album_list.js +++ b/module/album_list.js @@ -5,10 +5,17 @@ module.exports = (query, request) => { offset: query.offset || 0, total: true, area: query.area || 'ALL', //ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本 - type: query.type + type: query.type, } return request( - 'POST', `https://music.163.com/weapi/vipmall/albumproduct/list`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/vipmall/albumproduct/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/album_list_style.js b/module/album_list_style.js index 6bd7a39b8d0..00340581338 100644 --- a/module/album_list_style.js +++ b/module/album_list_style.js @@ -7,7 +7,14 @@ module.exports = (query, request) => { area: query.area || 'Z_H', //Z_H:华语,E_A:欧美,KR:韩国,JP:日本 } return request( - 'POST', `https://music.163.com/weapi/vipmall/appalbum/album/style`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/vipmall/appalbum/album/style`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/album_new.js b/module/album_new.js index 5889a2a122a..b4652d3ea3b 100644 --- a/module/album_new.js +++ b/module/album_new.js @@ -4,10 +4,12 @@ module.exports = (query, request) => { limit: query.limit || 30, offset: query.offset || 0, total: true, - area: query.area || 'ALL' //ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本 + area: query.area || 'ALL', //ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本 } - return request( - 'POST', `https://music.163.com/weapi/album/new`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/album/new`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/album_newest.js b/module/album_newest.js index 64742bb67da..cf94660f8d1 100644 --- a/module/album_newest.js +++ b/module/album_newest.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/api/discovery/newAlbum`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/discovery/newAlbum`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/album_songsaleboard.js b/module/album_songsaleboard.js index f761ab006d3..ec8efb47ec7 100644 --- a/module/album_songsaleboard.js +++ b/module/album_songsaleboard.js @@ -14,6 +14,11 @@ module.exports = (query, request) => { 'POST', `https://music.163.com/api/feealbum/songsaleboard/${type}/type`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/album_sub.js b/module/album_sub.js index f213bbb3934..65c6b245597 100644 --- a/module/album_sub.js +++ b/module/album_sub.js @@ -1,13 +1,14 @@ // 收藏/取消收藏专辑 module.exports = (query, request) => { - query.t = (query.t == 1 ? 'sub' : 'unsub') + query.t = query.t == 1 ? 'sub' : 'unsub' const data = { - id: query.id - }; + id: query.id, + } return request('POST', `https://music.163.com/api/album/${query.t}`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/album_sublist.js b/module/album_sublist.js index d129ae67349..5d01578a1fa 100644 --- a/module/album_sublist.js +++ b/module/album_sublist.js @@ -4,10 +4,12 @@ module.exports = (query, request) => { const data = { limit: query.limit || 25, offset: query.offset || 0, - total: true + total: true, } - return request( - 'POST', `https://music.163.com/weapi/album/sublist`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/album/sublist`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/artist_album.js b/module/artist_album.js index 50575f4643e..cafe2ed1727 100644 --- a/module/artist_album.js +++ b/module/artist_album.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 30, offset: query.offset || 0, - total: true + total: true, } return request( - 'POST', `https://music.163.com/weapi/artist/albums/${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/artist/albums/${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/artist_desc.js b/module/artist_desc.js index b209b3373ee..9237dc4cfc4 100644 --- a/module/artist_desc.js +++ b/module/artist_desc.js @@ -2,10 +2,17 @@ module.exports = (query, request) => { const data = { - id: query.id + id: query.id, } return request( - 'POST', `https://music.163.com/weapi/artist/introduction`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/artist/introduction`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/artist_list.js b/module/artist_list.js index b7b6ba5fc2a..fe95864ef0b 100644 --- a/module/artist_list.js +++ b/module/artist_list.js @@ -19,15 +19,19 @@ module.exports = (query, request) => { const data = { - initial: isNaN(query.initial) ? (query.initial || '').toUpperCase().charCodeAt() || undefined : query.initial, + initial: isNaN(query.initial) + ? (query.initial || '').toUpperCase().charCodeAt() || undefined + : query.initial, offset: query.offset || 0, limit: query.limit || 30, total: true, type: query.type || '1', - area: query.area + area: query.area, } - return request( - 'POST', `https://music.163.com/api/v1/artist/list`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/v1/artist/list`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/artist_mv.js b/module/artist_mv.js index 5c64156a570..8decc043700 100644 --- a/module/artist_mv.js +++ b/module/artist_mv.js @@ -5,10 +5,12 @@ module.exports = (query, request) => { artistId: query.id, limit: query.limit, offset: query.offset, - total: true + total: true, } - return request( - 'POST', `https://music.163.com/weapi/artist/mvs`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/artist/mvs`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/artist_sub.js b/module/artist_sub.js index 4d9115df964..4e9eebef221 100644 --- a/module/artist_sub.js +++ b/module/artist_sub.js @@ -1,13 +1,20 @@ // 收藏与取消收藏歌手 module.exports = (query, request) => { - query.t = (query.t == 1 ? 'sub' : 'unsub') + query.t = query.t == 1 ? 'sub' : 'unsub' const data = { artistId: query.id, - artistIds: '[' + query.id + ']' + artistIds: '[' + query.id + ']', } return request( - 'POST', `https://music.163.com/weapi/artist/${query.t}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/artist/${query.t}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/artist_sublist.js b/module/artist_sublist.js index e83405ab061..c4adf408c27 100644 --- a/module/artist_sublist.js +++ b/module/artist_sublist.js @@ -4,10 +4,12 @@ module.exports = (query, request) => { const data = { limit: query.limit || 25, offset: query.offset || 0, - total: true + total: true, } - return request( - 'POST', `https://music.163.com/weapi/artist/sublist`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/artist/sublist`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/artist_top_song.js b/module/artist_top_song.js index 5db32557b91..c86136e6758 100644 --- a/module/artist_top_song.js +++ b/module/artist_top_song.js @@ -1,10 +1,12 @@ // 歌手热门 50 首歌曲 module.exports = (query, request) => { const data = { - id: query.id + id: query.id, } - return request( - 'POST', `https://music.163.com/api/artist/top/song`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/artist/top/song`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/artists.js b/module/artists.js index 34ce5b7cc69..2e09262ab4c 100644 --- a/module/artists.js +++ b/module/artists.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/v1/artist/${query.id}`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/artist/${query.id}`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/avatar_upload.js b/module/avatar_upload.js index 2f5d603bf17..7b2ea18d167 100644 --- a/module/avatar_upload.js +++ b/module/avatar_upload.js @@ -5,9 +5,14 @@ module.exports = async (query, request) => { 'POST', `https://music.163.com/weapi/user/avatar/upload/v1`, { - imgid: uploadInfo.imgId + imgid: uploadInfo.imgId, }, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) return { status: 200, diff --git a/module/banner.js b/module/banner.js index 63a69d651ae..4e748f5091f 100644 --- a/module/banner.js +++ b/module/banner.js @@ -1,14 +1,17 @@ // 首页轮播图 module.exports = (query, request) => { - const type = { - 0: 'pc', - 1: 'android', - 2: 'iphone', - 3: 'ipad' - }[query.type || 0] || 'pc'; + const type = + { + 0: 'pc', + 1: 'android', + 2: 'iphone', + 3: 'ipad', + }[query.type || 0] || 'pc' return request( - 'POST', `https://music.163.com/api/v2/banner/get`, {clientType: type}, - {crypto: 'linuxapi', proxy: query.proxy} + 'POST', + `https://music.163.com/api/v2/banner/get`, + { clientType: type }, + { crypto: 'linuxapi', proxy: query.proxy, realIP: query.realIP } ) -} \ No newline at end of file +} diff --git a/module/batch.js b/module/batch.js index 641181e3003..a55252f1c1e 100644 --- a/module/batch.js +++ b/module/batch.js @@ -2,15 +2,18 @@ module.exports = (query, request) => { const data = { - 'e_r': true - }; - Object.keys(query).forEach(i => { + e_r: true, + } + Object.keys(query).forEach((i) => { if (/^\/api\//.test(i)) { data[i] = query[i] } }) - return request( - 'POST', `http://music.163.com/eapi/batch`, data, - {crypto: 'eapi', proxy: query.proxy, url: '/api/batch', cookie: query.cookie} - ) -}; \ No newline at end of file + return request('POST', `http://music.163.com/eapi/batch`, data, { + crypto: 'eapi', + proxy: query.proxy, + url: '/api/batch', + cookie: query.cookie, + realIP: query.realIP, + }) +} diff --git a/module/captcha_sent.js b/module/captcha_sent.js index 05d1c6a2104..ef7b3af771b 100644 --- a/module/captcha_sent.js +++ b/module/captcha_sent.js @@ -5,10 +5,10 @@ module.exports = (query, request) => { ctcode: query.ctcode || '86', cellphone: query.phone, } - return request( - 'POST', - `https://music.163.com/weapi/sms/captcha/sent`, - data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ) + return request('POST', `https://music.163.com/weapi/sms/captcha/sent`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) } diff --git a/module/captcha_verify.js b/module/captcha_verify.js index 0abe38805d5..472b9d21e63 100644 --- a/module/captcha_verify.js +++ b/module/captcha_verify.js @@ -4,12 +4,17 @@ module.exports = (query, request) => { const data = { ctcode: query.ctcode || '86', cellphone: query.phone, - captcha: query.captcha + captcha: query.captcha, } return request( 'POST', `https://music.163.com/weapi/sms/captcha/verify`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/cellphone_existence_check.js b/module/cellphone_existence_check.js index 229391c21e5..c79d03eb0e5 100644 --- a/module/cellphone_existence_check.js +++ b/module/cellphone_existence_check.js @@ -3,8 +3,8 @@ module.exports = (query, request) => { const data = { cellphone: query.phone, - countrycode: query.countrycode - }; + countrycode: query.countrycode, + } return request( 'POST', `http://music.163.com/eapi/cellphone/existence/check`, @@ -13,7 +13,8 @@ module.exports = (query, request) => { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/cellphone/existence/check' + url: '/api/cellphone/existence/check', + realIP: query.realIP, } - ); -}; + ) +} diff --git a/module/check_music.js b/module/check_music.js index 69f70d66907..1c750b12c97 100644 --- a/module/check_music.js +++ b/module/check_music.js @@ -3,27 +3,32 @@ module.exports = (query, request) => { const data = { ids: '[' + parseInt(query.id) + ']', - br: parseInt(query.br || 999000) + br: parseInt(query.br || 999000), } return request( - 'POST', `https://music.163.com/weapi/song/enhance/player/url`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) - .then(response => { - let playable = false - if(response.body.code == 200){ - if(response.body.data[0].code == 200){ - playable = true - } + 'POST', + `https://music.163.com/weapi/song/enhance/player/url`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ).then((response) => { + let playable = false + if (response.body.code == 200) { + if (response.body.data[0].code == 200) { + playable = true } - if(playable){ - response.body = {success: true, message: 'ok'} - return response - } - else{ - response.status = 404 - response.body = {success: false, message: '亲爱的,暂无版权'} - return Promise.reject(response) - } - }) -} \ No newline at end of file + } + if (playable) { + response.body = { success: true, message: 'ok' } + return response + } else { + response.status = 404 + response.body = { success: false, message: '亲爱的,暂无版权' } + return Promise.reject(response) + } + }) +} diff --git a/module/comment.js b/module/comment.js index dc1bb330929..39cbf874523 100644 --- a/module/comment.js +++ b/module/comment.js @@ -5,7 +5,7 @@ module.exports = (query, request) => { query.t = { 1: 'add', 0: 'delete', - 2: 'reply' + 2: 'reply', }[query.t] query.type = { 0: 'R_SO_4_', // 歌曲 @@ -14,25 +14,30 @@ module.exports = (query, request) => { 3: 'R_AL_3_', // 专辑 4: 'A_DJ_1_', // 电台, 5: 'R_VI_62_', // 视频 - 6: 'A_EV_2_' // 动态 + 6: 'A_EV_2_', // 动态 }[query.type] const data = { - threadId: query.type + query.id + threadId: query.type + query.id, } - - if(query.type == 'A_EV_2_'){ + + if (query.type == 'A_EV_2_') { data.threadId = query.threadId } - if(query.t == 'add') - data.content = query.content - else if(query.t == 'delete') - data.commentId = query.commentId + if (query.t == 'add') data.content = query.content + else if (query.t == 'delete') data.commentId = query.commentId else if (query.t == 'reply') { data.commentId = query.commentId data.content = query.content } return request( - 'POST', `https://music.163.com/weapi/resource/comments/${query.t}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/resource/comments/${query.t}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_album.js b/module/comment_album.js index 75d00c94a36..dbc42069b2e 100644 --- a/module/comment_album.js +++ b/module/comment_album.js @@ -6,10 +6,17 @@ module.exports = (query, request) => { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 + beforeTime: query.before || 0, } return request( - 'POST', `https://music.163.com/weapi/v1/resource/comments/R_AL_3_${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/resource/comments/R_AL_3_${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_dj.js b/module/comment_dj.js index cfb99e1fe4b..752588b62a1 100644 --- a/module/comment_dj.js +++ b/module/comment_dj.js @@ -6,10 +6,17 @@ module.exports = (query, request) => { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 + beforeTime: query.before || 0, } return request( - 'POST', `https://music.163.com/weapi/v1/resource/comments/A_DJ_1_${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/resource/comments/A_DJ_1_${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_event.js b/module/comment_event.js index 517ece98367..632056de2ce 100644 --- a/module/comment_event.js +++ b/module/comment_event.js @@ -4,12 +4,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 - }; + beforeTime: query.before || 0, + } return request( 'POST', `https://music.163.com/weapi/v1/resource/comments/${query.threadId}`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ); -}; + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/comment_hot.js b/module/comment_hot.js index f2bfe0d0c98..5c8c33ad101 100644 --- a/module/comment_hot.js +++ b/module/comment_hot.js @@ -8,16 +8,23 @@ module.exports = (query, request) => { 2: 'A_PL_0_', // 歌单 3: 'R_AL_3_', // 专辑 4: 'A_DJ_1_', // 电台, - 5: 'R_VI_62_' // 视频 + 5: 'R_VI_62_', // 视频 }[query.type] const data = { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 + beforeTime: query.before || 0, } return request( - 'POST', `https://music.163.com/weapi/v1/resource/hotcomments/${query.type}${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/resource/hotcomments/${query.type}${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_hotwall_list.js b/module/comment_hotwall_list.js index f0072fd0e11..f4d4a12dc0b 100644 --- a/module/comment_hotwall_list.js +++ b/module/comment_hotwall_list.js @@ -6,6 +6,11 @@ module.exports = (query, request) => { 'POST', `https://music.163.com/api/comment/hotwall/list/get`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/comment_like.js b/module/comment_like.js index 983f324f8f7..89fc8c13048 100644 --- a/module/comment_like.js +++ b/module/comment_like.js @@ -2,7 +2,7 @@ module.exports = (query, request) => { query.cookie.os = 'pc' - query.t = (query.t == 1 ? 'like' : 'unlike') + query.t = query.t == 1 ? 'like' : 'unlike' query.type = { 0: 'R_SO_4_', // 歌曲 1: 'R_MV_5_', // MV @@ -10,17 +10,24 @@ module.exports = (query, request) => { 3: 'R_AL_3_', // 专辑 4: 'A_DJ_1_', // 电台, 5: 'R_VI_62_', // 视频 - 6: 'A_EV_2_' // 动态 + 6: 'A_EV_2_', // 动态 }[query.type] const data = { threadId: query.type + query.id, - commentId: query.cid + commentId: query.cid, } - if(query.type == 'A_EV_2_'){ + if (query.type == 'A_EV_2_') { data.threadId = query.threadId } return request( - 'POST', `https://music.163.com/weapi/v1/comment/${query.t}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/comment/${query.t}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_music.js b/module/comment_music.js index 6c8308670d9..ee6f3a9a3c9 100644 --- a/module/comment_music.js +++ b/module/comment_music.js @@ -1,17 +1,22 @@ // 歌曲评论 module.exports = (query, request) => { - query.cookie.os = 'pc'; + query.cookie.os = 'pc' const data = { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 - }; + beforeTime: query.before || 0, + } return request( 'POST', `https://music.163.com/api/v1/resource/comments/R_SO_4_${query.id}`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ); -}; + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/comment_mv.js b/module/comment_mv.js index d6c0b76a4d2..d20681ceed3 100644 --- a/module/comment_mv.js +++ b/module/comment_mv.js @@ -6,10 +6,17 @@ module.exports = (query, request) => { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 + beforeTime: query.before || 0, } return request( - 'POST', `https://music.163.com/weapi/v1/resource/comments/R_MV_5_${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/resource/comments/R_MV_5_${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_playlist.js b/module/comment_playlist.js index e0ef723915d..7bdc27f6a8e 100644 --- a/module/comment_playlist.js +++ b/module/comment_playlist.js @@ -6,10 +6,17 @@ module.exports = (query, request) => { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 + beforeTime: query.before || 0, } return request( - 'POST', `https://music.163.com/weapi/v1/resource/comments/A_PL_0_${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/resource/comments/A_PL_0_${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/comment_video.js b/module/comment_video.js index 452f1373cc0..d89d4d4a078 100644 --- a/module/comment_video.js +++ b/module/comment_video.js @@ -6,10 +6,17 @@ module.exports = (query, request) => { rid: query.id, limit: query.limit || 20, offset: query.offset || 0, - beforeTime: query.before || 0 + beforeTime: query.before || 0, } return request( - 'POST', `https://music.163.com/weapi/v1/resource/comments/R_VI_62_${query.id}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/resource/comments/R_VI_62_${query.id}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/countries_code_list.js b/module/countries_code_list.js index 3adf40ff3df..32d88523763 100644 --- a/module/countries_code_list.js +++ b/module/countries_code_list.js @@ -2,12 +2,15 @@ module.exports = (query, request) => { const data = {} return request( - 'POST', `http://interface3.music.163.com/eapi/lbs/countries/v1`, data, + 'POST', + `http://interface3.music.163.com/eapi/lbs/countries/v1`, + data, { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/lbs/countries/v1' + url: '/api/lbs/countries/v1', + realIP: query.realIP, } ) -} \ No newline at end of file +} diff --git a/module/daily_signin.js b/module/daily_signin.js index 10c34038b68..2bb7deef7f3 100644 --- a/module/daily_signin.js +++ b/module/daily_signin.js @@ -9,10 +9,12 @@ module.exports = (query, request) => { const data = { - type: query.type || 0 + type: query.type || 0, } - return request( - 'POST', `https://music.163.com/weapi/point/dailyTask`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/point/dailyTask`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/digitalAlbum_ordering.js b/module/digitalAlbum_ordering.js index 0820399f6f7..7c930b9a544 100644 --- a/module/digitalAlbum_ordering.js +++ b/module/digitalAlbum_ordering.js @@ -4,15 +4,24 @@ module.exports = (query, request) => { const data = { business: 'Album', paymentMethod: query.payment, - digitalResources: JSON.stringify([{ - business: 'Album', - resourceID: query.id, - quantity: query.quantity, - }]), - from: 'web' + digitalResources: JSON.stringify([ + { + business: 'Album', + resourceID: query.id, + quantity: query.quantity, + }, + ]), + from: 'web', } return request( - 'POST', `https://music.163.com/api/ordering/web/digital`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/ordering/web/digital`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/digitalAlbum_purchased.js b/module/digitalAlbum_purchased.js index 50b572c0e7b..3608f917c20 100644 --- a/module/digitalAlbum_purchased.js +++ b/module/digitalAlbum_purchased.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 30, offset: query.offset || 0, - total: true + total: true, } return request( - 'POST', `https://music.163.com/api/digitalAlbum/purchased`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/digitalAlbum/purchased`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_banner.js b/module/dj_banner.js index ca37c914fd2..32551feb6ce 100644 --- a/module/dj_banner.js +++ b/module/dj_banner.js @@ -1,12 +1,17 @@ // 电台banner module.exports = (query, request) => { - const data = {}; - query.cookie.os = 'pc'; + const data = {} + query.cookie.os = 'pc' return request( 'POST', `http://music.163.com/weapi/djradio/banner/get`, {}, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ); -}; + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/dj_category_excludehot.js b/module/dj_category_excludehot.js index f184ceec072..b61c43866cb 100644 --- a/module/dj_category_excludehot.js +++ b/module/dj_category_excludehot.js @@ -1,9 +1,15 @@ // 电台非热门类型 module.exports = (query, request) => { - return request( - 'POST', `http://music.163.com/weapi/djradio/category/excludehot`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `http://music.163.com/weapi/djradio/category/excludehot`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -}; \ No newline at end of file +} diff --git a/module/dj_category_recommend.js b/module/dj_category_recommend.js index 864f3e8b57f..a45782fd269 100644 --- a/module/dj_category_recommend.js +++ b/module/dj_category_recommend.js @@ -1,9 +1,15 @@ // 电台推荐类型 module.exports = (query, request) => { - return request( - 'POST', `http://music.163.com/weapi/djradio/home/category/recommend`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `http://music.163.com/weapi/djradio/home/category/recommend`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -}; \ No newline at end of file +} diff --git a/module/dj_catelist.js b/module/dj_catelist.js index 934df2646bc..f4698fe602c 100644 --- a/module/dj_catelist.js +++ b/module/dj_catelist.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/djradio/category/get`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/djradio/category/get`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_detail.js b/module/dj_detail.js index e987699d15f..5b680c87ca4 100644 --- a/module/dj_detail.js +++ b/module/dj_detail.js @@ -2,10 +2,12 @@ module.exports = (query, request) => { const data = { - id: query.rid + id: query.rid, } - return request( - 'POST', `https://music.163.com/weapi/djradio/get`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/djradio/get`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/dj_hot.js b/module/dj_hot.js index c7655d8c056..5f7e30f0723 100644 --- a/module/dj_hot.js +++ b/module/dj_hot.js @@ -3,10 +3,12 @@ module.exports = (query, request) => { const data = { limit: query.limit || 30, - offset: query.offset || 0 + offset: query.offset || 0, } - return request( - 'POST', `https://music.163.com/weapi/djradio/hot/v1`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/djradio/hot/v1`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/dj_paygift.js b/module/dj_paygift.js index 5fc6823a8ef..96362a38ba4 100644 --- a/module/dj_paygift.js +++ b/module/dj_paygift.js @@ -3,10 +3,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 30, - offset: query.offset || 0 + offset: query.offset || 0, } return request( - 'POST', `https://music.163.com/weapi/djradio/home/paygift/list?_nmclfl=1`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/djradio/home/paygift/list?_nmclfl=1`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_program.js b/module/dj_program.js index a2a58d13984..a95df08f82e 100644 --- a/module/dj_program.js +++ b/module/dj_program.js @@ -5,12 +5,17 @@ module.exports = (query, request) => { radioId: query.rid, limit: query.limit || 30, offset: query.offset || 0, - asc: toBoolean(query.asc) + asc: toBoolean(query.asc), } return request( 'POST', `https://music.163.com/weapi/dj/program/byradio`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/dj_program_detail.js b/module/dj_program_detail.js index 09f9699149e..b424937b070 100644 --- a/module/dj_program_detail.js +++ b/module/dj_program_detail.js @@ -2,10 +2,17 @@ module.exports = (query, request) => { const data = { - id: query.id + id: query.id, } return request( - 'POST', `https://music.163.com/weapi/dj/program/detail`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/dj/program/detail`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_program_toplist.js b/module/dj_program_toplist.js index 3ec08b3e57a..898cf9d1c5a 100644 --- a/module/dj_program_toplist.js +++ b/module/dj_program_toplist.js @@ -3,10 +3,12 @@ module.exports = (query, request) => { const data = { limit: query.limit || 100, - offset: query.offset || 0 + offset: query.offset || 0, } - return request( - 'POST', `https://music.163.com/api/program/toplist/v1`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/program/toplist/v1`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/dj_program_toplist_hours.js b/module/dj_program_toplist_hours.js index 7d8de24d3ae..d8bb2d73733 100644 --- a/module/dj_program_toplist_hours.js +++ b/module/dj_program_toplist_hours.js @@ -1,11 +1,18 @@ // 电台24小时节目榜 module.exports = (query, request) => { const data = { - limit: query.limit || 100 + limit: query.limit || 100, // 不支持 offset } return request( - 'POST', `https://music.163.com/api/djprogram/toplist/hours`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/djprogram/toplist/hours`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_radio_hot.js b/module/dj_radio_hot.js index d618b4777ed..30e0b42ebc2 100644 --- a/module/dj_radio_hot.js +++ b/module/dj_radio_hot.js @@ -4,10 +4,12 @@ module.exports = (query, request) => { const data = { cateId: query.cateId, limit: query.limit || 30, - offset: query.offset || 0 + offset: query.offset || 0, } - return request( - 'POST', `https://music.163.com/api/djradio/hot`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/djradio/hot`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/dj_recommend.js b/module/dj_recommend.js index 0a4536dd642..9266805e92f 100644 --- a/module/dj_recommend.js +++ b/module/dj_recommend.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/djradio/recommend/v1`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/djradio/recommend/v1`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/dj_recommend_type.js b/module/dj_recommend_type.js index c66777c01f2..0956b23a724 100644 --- a/module/dj_recommend_type.js +++ b/module/dj_recommend_type.js @@ -25,10 +25,17 @@ module.exports = (query, request) => { const data = { - cateId: query.type + cateId: query.type, } return request( - 'POST', `https://music.163.com/weapi/djradio/recommend`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/djradio/recommend`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_sub.js b/module/dj_sub.js index 0e8559a7256..f604ae40a25 100644 --- a/module/dj_sub.js +++ b/module/dj_sub.js @@ -1,12 +1,19 @@ // 订阅与取消电台 module.exports = (query, request) => { - query.t = (query.t == 1 ? 'sub' : 'unsub') + query.t = query.t == 1 ? 'sub' : 'unsub' const data = { - id: query.rid + id: query.rid, } return request( - 'POST', `https://music.163.com/weapi/djradio/${query.t}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/djradio/${query.t}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_sublist.js b/module/dj_sublist.js index f1ef137ff04..91d15e2bc67 100644 --- a/module/dj_sublist.js +++ b/module/dj_sublist.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 30, offset: query.offset || 0, - total: true + total: true, } return request( - 'POST', `https://music.163.com/weapi/djradio/get/subed`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/djradio/get/subed`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_today_perfered.js b/module/dj_today_perfered.js index ab100264efc..78e2e950dd9 100644 --- a/module/dj_today_perfered.js +++ b/module/dj_today_perfered.js @@ -2,10 +2,17 @@ module.exports = (query, request) => { const data = { - page: query.page || 0 - }; + page: query.page || 0, + } return request( - 'POST', `http://music.163.com/weapi/djradio/home/today/perfered`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `http://music.163.com/weapi/djradio/home/today/perfered`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -}; \ No newline at end of file +} diff --git a/module/dj_toplist.js b/module/dj_toplist.js index 92002193005..cbe04d76b53 100644 --- a/module/dj_toplist.js +++ b/module/dj_toplist.js @@ -1,16 +1,18 @@ // 新晋电台榜/热门电台榜 const typeMap = { - 'new': 0, - 'hot': 1 + new: 0, + hot: 1, } module.exports = (query, request) => { const data = { limit: query.limit || 100, offset: query.offset || 0, - type: typeMap[query.type || 'new'] || '0' //0为新晋,1为热门 + type: typeMap[query.type || 'new'] || '0', //0为新晋,1为热门 } - return request( - 'POST', `https://music.163.com/api/djradio/toplist`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/djradio/toplist`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/dj_toplist_hours.js b/module/dj_toplist_hours.js index 37c6040a491..8c8b6a37874 100644 --- a/module/dj_toplist_hours.js +++ b/module/dj_toplist_hours.js @@ -2,11 +2,13 @@ module.exports = (query, request) => { const data = { - limit: query.limit || 100 + limit: query.limit || 100, // 不支持 offset } - return request( - 'POST', `https://music.163.com/api/dj/toplist/hours`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/dj/toplist/hours`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/dj_toplist_newcomer.js b/module/dj_toplist_newcomer.js index b3a3588e5b6..e6b75d47b7f 100644 --- a/module/dj_toplist_newcomer.js +++ b/module/dj_toplist_newcomer.js @@ -2,10 +2,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 100, - offset: query.offset || 0 + offset: query.offset || 0, } return request( - 'POST', `https://music.163.com/api/dj/toplist/newcomer`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/dj/toplist/newcomer`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_toplist_pay.js b/module/dj_toplist_pay.js index c82802dfbd8..6fd526c3e4e 100644 --- a/module/dj_toplist_pay.js +++ b/module/dj_toplist_pay.js @@ -1,11 +1,18 @@ // 付费精品 module.exports = (query, request) => { const data = { - limit: query.limit || 100 + limit: query.limit || 100, // 不支持 offset } return request( - 'POST', `https://music.163.com/api/djradio/toplist/pay`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/djradio/toplist/pay`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/dj_toplist_popular.js b/module/dj_toplist_popular.js index ef261d70f49..fcb0b33c1d5 100644 --- a/module/dj_toplist_popular.js +++ b/module/dj_toplist_popular.js @@ -2,11 +2,13 @@ module.exports = (query, request) => { const data = { - limit: query.limit || 100 + limit: query.limit || 100, // 不支持 offset } - return request( - 'POST', `https://music.163.com/api/dj/toplist/popular`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/dj/toplist/popular`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/event.js b/module/event.js index 48fa875a1fd..b975ab72827 100644 --- a/module/event.js +++ b/module/event.js @@ -2,11 +2,13 @@ module.exports = (query, request) => { const data = { - 'pagesize': query.pagesize || 20, - 'lasttime': query.lasttime || -1 + pagesize: query.pagesize || 20, + lasttime: query.lasttime || -1, } - return request( - 'POST', `https://music.163.com/weapi/v1/event/get`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/v1/event/get`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/event_del.js b/module/event_del.js index 6baa1ece583..8f17ebeb93f 100644 --- a/module/event_del.js +++ b/module/event_del.js @@ -4,8 +4,10 @@ module.exports = (query, request) => { const data = { id: query.evId, } - return request( - 'POST', `https://music.163.com/eapi/event/delete`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/eapi/event/delete`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/event_forward.js b/module/event_forward.js index daba5a45233..f4eddc4334d 100644 --- a/module/event_forward.js +++ b/module/event_forward.js @@ -1,15 +1,16 @@ // 转发动态 module.exports = (query, request) => { - query.cookie.os = 'pc'; + query.cookie.os = 'pc' const data = { forwards: query.forwards, id: query.evId, - eventUserId: query.uid - }; + eventUserId: query.uid, + } return request('POST', `https://music.163.com/weapi/event/forward`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/fm_trash.js b/module/fm_trash.js index 8b84f0e144b..224d2daad2c 100644 --- a/module/fm_trash.js +++ b/module/fm_trash.js @@ -2,10 +2,19 @@ module.exports = (query, request) => { const data = { - songId: query.id + songId: query.id, } return request( - 'POST', `https://music.163.com/weapi/radio/trash/add?alg=RT&songId=${query.id}&time=${query.time || 25}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/radio/trash/add?alg=RT&songId=${ + query.id + }&time=${query.time || 25}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/follow.js b/module/follow.js index 41718b02158..1e4f3939b2f 100644 --- a/module/follow.js +++ b/module/follow.js @@ -2,9 +2,16 @@ module.exports = (query, request) => { query.cookie.os = 'pc' - query.t = (query.t == 1 ? 'follow' : 'delfollow') + query.t = query.t == 1 ? 'follow' : 'delfollow' return request( - 'POST', `https://music.163.com/weapi/user/${query.t}/${query.id}`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/user/${query.t}/${query.id}`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/history_recommend_songs.js b/module/history_recommend_songs.js index 3f1afeba088..67c1b0bd70a 100644 --- a/module/history_recommend_songs.js +++ b/module/history_recommend_songs.js @@ -2,10 +2,16 @@ module.exports = (query, request) => { query.cookie.os = 'ios' - const data = { - } + const data = {} return request( - 'POST', `https://music.163.com/api/discovery/recommend/songs/history/recent`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/discovery/recommend/songs/history/recent`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/history_recommend_songs_detail.js b/module/history_recommend_songs_detail.js index 990ad5db4a8..b5d3645a58a 100644 --- a/module/history_recommend_songs_detail.js +++ b/module/history_recommend_songs_detail.js @@ -6,7 +6,14 @@ module.exports = (query, request) => { date: query.date || '', } return request( - 'POST', `https://music.163.com/api/discovery/recommend/songs/history/detail`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/discovery/recommend/songs/history/detail`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/homepage_block_page.js b/module/homepage_block_page.js index bb57f5b35bb..4cfd94673e0 100644 --- a/module/homepage_block_page.js +++ b/module/homepage_block_page.js @@ -1,10 +1,17 @@ // 首页-发现 block page -// 这个接口为移动端接口,首页-发现页,数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L259 HomeBlockPageWrap +// 这个接口为移动端接口,首页-发现页,数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L259 HomeBlockPageWrap // query.refresh 是否刷新数据 module.exports = (query, request) => { - const data = { 'refresh': query.refresh || true } + const data = { refresh: query.refresh || true } return request( - 'POST', `https://music.163.com/api/homepage/block/page`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + 'POST', + `https://music.163.com/api/homepage/block/page`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/homepage_dragon_ball.js b/module/homepage_dragon_ball.js index ac155395903..e76911a3029 100644 --- a/module/homepage_dragon_ball.js +++ b/module/homepage_dragon_ball.js @@ -1,16 +1,19 @@ // 首页-发现 dragon ball // 这个接口为移动端接口,首页-发现页(每日推荐、歌单、排行榜 那些入口) -// 数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L290 HomeDragonBallWrap +// 数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L290 HomeDragonBallWrap // !需要登录或者匿名登录,非登录返回 [] module.exports = (query, request) => { const data = {} return request( - 'POST', `https://music.163.com/eapi/homepage/dragon/ball/static`, data, + 'POST', + `https://music.163.com/eapi/homepage/dragon/ball/static`, + data, { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/homepage/dragon/ball/static' + url: '/api/homepage/dragon/ball/static', + realIP: query.realIP, } ) -} \ No newline at end of file +} diff --git a/module/hot_topic.js b/module/hot_topic.js index c1889ba9d9c..bba8480b6ba 100644 --- a/module/hot_topic.js +++ b/module/hot_topic.js @@ -3,10 +3,12 @@ module.exports = (query, request) => { const data = { limit: query.limit || 20, - offset: query.offset || 0 + offset: query.offset || 0, } - return request( - 'POST', `http://music.163.com/weapi/act/hot`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -}; \ No newline at end of file + return request('POST', `http://music.163.com/weapi/act/hot`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/like.js b/module/like.js index f44e58a1e8d..1aea4055431 100644 --- a/module/like.js +++ b/module/like.js @@ -5,14 +5,19 @@ module.exports = (query, request) => { query.like = query.like == 'false' ? false : true const data = { trackId: query.id, - like: query.like + like: query.like, } return request( 'POST', - `https://music.163.com/weapi/radio/like?alg=${query.alg || - 'itembased'}&trackId=${query.id}&time=${query.time || - 25}`, + `https://music.163.com/weapi/radio/like?alg=${ + query.alg || 'itembased' + }&trackId=${query.id}&time=${query.time || 25}`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/likelist.js b/module/likelist.js index 3cc0f34455f..abb46809fd1 100644 --- a/module/likelist.js +++ b/module/likelist.js @@ -2,10 +2,12 @@ module.exports = (query, request) => { const data = { - uid: query.uid + uid: query.uid, } - return request( - 'POST', `https://music.163.com/weapi/song/like/get`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/song/like/get`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/login.js b/module/login.js index b77c083ded5..a201b6ff372 100644 --- a/module/login.js +++ b/module/login.js @@ -6,21 +6,31 @@ module.exports = async (query, request) => { query.cookie.os = 'pc' const data = { username: query.email, - password: query.md5_password || crypto.createHash('md5').update(query.password).digest('hex'), - rememberLogin: 'true' + password: + query.md5_password || + crypto.createHash('md5').update(query.password).digest('hex'), + rememberLogin: 'true', } let result = await request( - 'POST', `https://music.163.com/weapi/login`, data, - { crypto: 'weapi', ua: 'pc', cookie: query.cookie, proxy: query.proxy } + 'POST', + `https://music.163.com/weapi/login`, + data, + { + crypto: 'weapi', + ua: 'pc', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) if (result.body.code === 502) { return { status: 200, body: { - 'msg': '账号或密码错误', - 'code': 502, - 'message': '账号或密码错误' - } + msg: '账号或密码错误', + code: 502, + message: '账号或密码错误', + }, } } if (result.body.code === 200) { @@ -28,10 +38,10 @@ module.exports = async (query, request) => { status: 200, body: { ...result.body, - cookie: result.cookie.join(';') + cookie: result.cookie.join(';'), }, - cookie: result.cookie + cookie: result.cookie, } } return result -} \ No newline at end of file +} diff --git a/module/login_cellphone.js b/module/login_cellphone.js index 51bca302c74..f33f2c1f946 100644 --- a/module/login_cellphone.js +++ b/module/login_cellphone.js @@ -7,22 +7,32 @@ module.exports = async (query, request) => { const data = { phone: query.phone, countrycode: query.countrycode, - password: query.md5_password || crypto.createHash('md5').update(query.password).digest('hex'), - rememberLogin: 'true' + password: + query.md5_password || + crypto.createHash('md5').update(query.password).digest('hex'), + rememberLogin: 'true', } let result = await request( - 'POST', `https://music.163.com/weapi/login/cellphone`, data, - {crypto: 'weapi', ua: 'pc', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/login/cellphone`, + data, + { + crypto: 'weapi', + ua: 'pc', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) - + if (result.body.code === 200) { result = { status: 200, body: { ...result.body, - cookie: result.cookie.join(';') + cookie: result.cookie.join(';'), }, - cookie: result.cookie + cookie: result.cookie, } } return result diff --git a/module/login_refresh.js b/module/login_refresh.js index a6f43f2cbfa..2a6e88ad71f 100644 --- a/module/login_refresh.js +++ b/module/login_refresh.js @@ -2,7 +2,15 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/login/token/refresh`, {}, - {crypto: 'weapi', ua: 'pc', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/login/token/refresh`, + {}, + { + crypto: 'weapi', + ua: 'pc', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/login_status.js b/module/login_status.js index 91f417fb4fd..b653a0f9c27 100644 --- a/module/login_status.js +++ b/module/login_status.js @@ -2,20 +2,20 @@ module.exports = (query, request) => { return request( - 'GET', `https://music.163.com`, {}, - {cookie: query.cookie, proxy: query.proxy} - ) - .then(response => { - try{ - let profile = eval(`(${/GUser\s*=\s*([^;]+);/.exec(response.body)[1]})`) - let bindings = eval(`(${/GBinds\s*=\s*([^;]+);/.exec(response.body)[1]})`) - response.body = {code: 200, profile: profile, bindings: bindings} - return response - } - catch(err){ - response.status = 301 - response.body = {code: 301} - return Promise.reject(response) - } - }) -} \ No newline at end of file + 'GET', + `https://music.163.com`, + {}, + { cookie: query.cookie, proxy: query.proxy, realIP: query.realIP } + ).then((response) => { + try { + let profile = eval(`(${/GUser\s*=\s*([^;]+);/.exec(response.body)[1]})`) + let bindings = eval(`(${/GBinds\s*=\s*([^;]+);/.exec(response.body)[1]})`) + response.body = { code: 200, profile: profile, bindings: bindings } + return response + } catch (err) { + response.status = 301 + response.body = { code: 301 } + return Promise.reject(response) + } + }) +} diff --git a/module/logout.js b/module/logout.js index d5f3b7db635..4bae68821b2 100644 --- a/module/logout.js +++ b/module/logout.js @@ -2,7 +2,15 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/logout`, {}, - {crypto: 'weapi', ua: 'pc', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/logout`, + {}, + { + crypto: 'weapi', + ua: 'pc', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/lyric.js b/module/lyric.js index 760dc417dd4..1c1a7fbb87b 100644 --- a/module/lyric.js +++ b/module/lyric.js @@ -1,17 +1,17 @@ // 歌词 module.exports = (query, request) => { - query.cookie.os = 'pc'; + query.cookie.os = 'pc' const data = { id: query.id, lv: -1, kv: -1, - tv: -1 + tv: -1, } - return request( - 'POST', - `https://music.163.com/api/song/lyric`, - data, - { crypto: 'linuxapi', cookie: query.cookie, proxy: query.proxy } - ) + return request('POST', `https://music.163.com/api/song/lyric`, data, { + crypto: 'linuxapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) } diff --git a/module/msg_comments.js b/module/msg_comments.js index 36e1e38959b..f1bef5bd412 100644 --- a/module/msg_comments.js +++ b/module/msg_comments.js @@ -5,9 +5,9 @@ module.exports = (query, request) => { beforeTime: query.before || '-1', limit: query.limit || 30, total: 'true', - uid: query.uid - }; - + uid: query.uid, + } + return request( 'POST', `https://music.163.com/api/v1/user/comments/${query.uid}`, @@ -15,7 +15,8 @@ module.exports = (query, request) => { { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy + proxy: query.proxy, + realIP: query.realIP, } - ); -}; + ) +} diff --git a/module/msg_forwards.js b/module/msg_forwards.js index 8663bf4b31f..f89dc989d72 100644 --- a/module/msg_forwards.js +++ b/module/msg_forwards.js @@ -4,11 +4,12 @@ module.exports = (query, request) => { const data = { offset: query.offset || 0, limit: query.limit || 30, - total: 'true' - }; + total: 'true', + } return request('POST', `https://music.163.com/api/forwards/get`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/msg_notices.js b/module/msg_notices.js index 0578ba87fd1..9208168bb62 100644 --- a/module/msg_notices.js +++ b/module/msg_notices.js @@ -3,11 +3,12 @@ module.exports = (query, request) => { const data = { limit: query.limit || 30, - time: query.lasttime || -1 - }; + time: query.lasttime || -1, + } return request('POST', `https://music.163.com/api/msg/notices`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/msg_private.js b/module/msg_private.js index 91f9ea5d953..a30751c682f 100644 --- a/module/msg_private.js +++ b/module/msg_private.js @@ -5,10 +5,11 @@ module.exports = (query, request) => { offset: query.offset || 0, limit: query.limit || 30, total: 'true', - }; + } return request('POST', `https://music.163.com/api/msg/private/users`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/msg_private_history.js b/module/msg_private_history.js index 27ad29180f9..bfbedde5e2d 100644 --- a/module/msg_private_history.js +++ b/module/msg_private_history.js @@ -5,8 +5,8 @@ module.exports = (query, request) => { userId: query.uid, limit: query.limit || 30, time: query.before || 0, - total: 'true' - }; + total: 'true', + } return request( 'POST', `https://music.163.com/api/msg/private/history`, @@ -14,7 +14,8 @@ module.exports = (query, request) => { { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy + proxy: query.proxy, + realIP: query.realIP, } - ); -}; + ) +} diff --git a/module/mv_all.js b/module/mv_all.js index 42777dfde4c..85c1c464978 100644 --- a/module/mv_all.js +++ b/module/mv_all.js @@ -5,15 +5,16 @@ module.exports = (query, request) => { tags: JSON.stringify({ 地区: query.area || '全部', 类型: query.type || '全部', - 排序: query.order || '上升最快' + 排序: query.order || '上升最快', }), offset: query.offset || 0, total: 'true', - limit: query.limit || 30 - }; + limit: query.limit || 30, + } return request('POST', `https://interface.music.163.com/api/mv/all`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/mv_detail.js b/module/mv_detail.js index 1cda103d92e..e1b0152ee0c 100644 --- a/module/mv_detail.js +++ b/module/mv_detail.js @@ -2,10 +2,12 @@ module.exports = (query, request) => { const data = { - id: query.mvid + id: query.mvid, } - return request( - 'POST', `https://music.163.com/api/v1/mv/detail`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/api/v1/mv/detail`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/mv_detail_info.js b/module/mv_detail_info.js index c7aad0b660c..61c4707c3f5 100644 --- a/module/mv_detail_info.js +++ b/module/mv_detail_info.js @@ -2,11 +2,18 @@ module.exports = (query, request) => { const data = { - 'threadid': `R_MV_5_${query.mvid}`, - 'composeliked': true + threadid: `R_MV_5_${query.mvid}`, + composeliked: true, } return request( - 'POST', `https://music.163.com/api/comment/commentthread/info`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + 'POST', + `https://music.163.com/api/comment/commentthread/info`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/mv_exclusive_rcmd.js b/module/mv_exclusive_rcmd.js index 8aaf715ce91..8ea3043e55d 100644 --- a/module/mv_exclusive_rcmd.js +++ b/module/mv_exclusive_rcmd.js @@ -3,8 +3,8 @@ module.exports = (query, request) => { const data = { offset: query.offset || 0, - limit: query.limit || 30 - }; + limit: query.limit || 30, + } return request( 'POST', `https://interface.music.163.com/api/mv/exclusive/rcmd`, @@ -12,7 +12,8 @@ module.exports = (query, request) => { { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy + proxy: query.proxy, + realIP: query.realIP, } - ); -}; + ) +} diff --git a/module/mv_first.js b/module/mv_first.js index e83e372009a..d22f60ebf58 100644 --- a/module/mv_first.js +++ b/module/mv_first.js @@ -5,11 +5,17 @@ module.exports = (query, request) => { // 'offset': query.offset || 0, area: query.area || '', limit: query.limit || 30, - total: true - }; - return request('POST', `https://interface.music.163.com/weapi/mv/first`, data, { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy - }); -}; + total: true, + } + return request( + 'POST', + `https://interface.music.163.com/weapi/mv/first`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/mv_sub.js b/module/mv_sub.js index 9f2c225c4f8..249998e9407 100644 --- a/module/mv_sub.js +++ b/module/mv_sub.js @@ -1,13 +1,15 @@ // 收藏与取消收藏MV module.exports = (query, request) => { - query.t = (query.t == 1 ? 'sub' : 'unsub') + query.t = query.t == 1 ? 'sub' : 'unsub' const data = { mvId: query.mvid, - mvIds: '["' + query.mvid + '"]' - } - return request( - 'POST', `https://music.163.com/weapi/mv/${query.t}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + mvIds: '["' + query.mvid + '"]', + } + return request('POST', `https://music.163.com/weapi/mv/${query.t}`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/mv_sublist.js b/module/mv_sublist.js index 1330849ffa7..d86633b7c3d 100644 --- a/module/mv_sublist.js +++ b/module/mv_sublist.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { limit: query.limit || 25, offset: query.offset || 0, - total: true + total: true, } return request( - 'POST', `https://music.163.com/weapi/cloudvideo/allvideo/sublist`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/cloudvideo/allvideo/sublist`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/mv_url.js b/module/mv_url.js index d4bb7d2cd2a..b8e778394b1 100644 --- a/module/mv_url.js +++ b/module/mv_url.js @@ -3,10 +3,17 @@ module.exports = (query, request) => { const data = { id: query.id, - r: query.res || 1080 + r: query.res || 1080, } return request( - 'POST', `https://music.163.com/weapi/song/enhance/play/mv/url`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/song/enhance/play/mv/url`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personal_fm.js b/module/personal_fm.js index 7c0d70f54f0..e2f7a589f81 100644 --- a/module/personal_fm.js +++ b/module/personal_fm.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/v1/radio/get`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/radio/get`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personalized.js b/module/personalized.js index 73748e5571a..45f22bc0242 100644 --- a/module/personalized.js +++ b/module/personalized.js @@ -5,10 +5,17 @@ module.exports = (query, request) => { limit: query.limit || 30, // offset: query.offset || 0, total: true, - n: 1000 + n: 1000, } return request( - 'POST', `https://music.163.com/weapi/personalized/playlist`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/personalized/playlist`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personalized_djprogram.js b/module/personalized_djprogram.js index 4e43afc89be..9b945b4ba94 100644 --- a/module/personalized_djprogram.js +++ b/module/personalized_djprogram.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/personalized/djprogram`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/personalized/djprogram`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personalized_mv.js b/module/personalized_mv.js index 325a764ae42..0af706f1a72 100644 --- a/module/personalized_mv.js +++ b/module/personalized_mv.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/personalized/mv`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/personalized/mv`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personalized_newsong.js b/module/personalized_newsong.js index 7ce289be823..efce8148b79 100644 --- a/module/personalized_newsong.js +++ b/module/personalized_newsong.js @@ -2,10 +2,17 @@ module.exports = (query, request) => { const data = { - type: 'recommend' + type: 'recommend', } return request( - 'POST', `https://music.163.com/weapi/personalized/newsong`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/personalized/newsong`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personalized_privatecontent.js b/module/personalized_privatecontent.js index 2c9b3ae7530..b516d1ab041 100644 --- a/module/personalized_privatecontent.js +++ b/module/personalized_privatecontent.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/personalized/privatecontent`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/personalized/privatecontent`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/personalized_privatecontent_list.js b/module/personalized_privatecontent_list.js index 8b47188f077..35fa1868f53 100644 --- a/module/personalized_privatecontent_list.js +++ b/module/personalized_privatecontent_list.js @@ -8,7 +8,13 @@ module.exports = (query, request) => { } return request( 'POST', - `https://music.163.com/api/v2/privatecontent/list`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + `https://music.163.com/api/v2/privatecontent/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) } diff --git a/module/playlist_catlist.js b/module/playlist_catlist.js index e354d4af714..814882eab82 100644 --- a/module/playlist_catlist.js +++ b/module/playlist_catlist.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/playlist/catalogue`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/playlist/catalogue`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/playlist_cover_update.js b/module/playlist_cover_update.js index 96b68ebaea5..ef529ecd258 100644 --- a/module/playlist_cover_update.js +++ b/module/playlist_cover_update.js @@ -6,9 +6,14 @@ module.exports = async (query, request) => { `https://music.163.com/weapi/playlist/cover/update`, { id: query.id, - coverImgId: uploadInfo.imgId + coverImgId: uploadInfo.imgId, }, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) return { status: 200, diff --git a/module/playlist_create.js b/module/playlist_create.js index a8abe547186..7790ae13c95 100644 --- a/module/playlist_create.js +++ b/module/playlist_create.js @@ -1,14 +1,15 @@ // 创建歌单 module.exports = (query, request) => { - query.cookie.os = 'pc'; + query.cookie.os = 'pc' const data = { name: query.name, - privacy: query.privacy //0 为普通歌单,10 为隐私歌单 - }; + privacy: query.privacy, //0 为普通歌单,10 为隐私歌单 + } return request('POST', `https://music.163.com/weapi/playlist/create`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/playlist_delete.js b/module/playlist_delete.js index d2032727db1..d388a0ebfeb 100644 --- a/module/playlist_delete.js +++ b/module/playlist_delete.js @@ -1,13 +1,14 @@ // 删除歌单 module.exports = (query, request) => { - query.cookie.os = 'pc'; + query.cookie.os = 'pc' const data = { - ids: '[' + query.id + ']' - }; + ids: '[' + query.id + ']', + } return request('POST', `https://music.163.com/weapi/playlist/remove`, data, { crypto: 'weapi', cookie: query.cookie, - proxy: query.proxy - }); -}; + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/playlist_desc_update.js b/module/playlist_desc_update.js index 316df107b84..790229afced 100644 --- a/module/playlist_desc_update.js +++ b/module/playlist_desc_update.js @@ -3,15 +3,18 @@ module.exports = (query, request) => { const data = { id: query.id, - desc: query.desc + desc: query.desc, } return request( - 'POST', `http://interface3.music.163.com/eapi/playlist/desc/update`, data, + 'POST', + `http://interface3.music.163.com/eapi/playlist/desc/update`, + data, { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/playlist/desc/update' + url: '/api/playlist/desc/update', + realIP: query.realIP, } ) -} \ No newline at end of file +} diff --git a/module/playlist_detail.js b/module/playlist_detail.js index 22f36e0258c..4f65b380da9 100644 --- a/module/playlist_detail.js +++ b/module/playlist_detail.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { id: query.id, n: 100000, - s: query.s || 8 + s: query.s || 8, } return request( - 'POST', `https://music.163.com/weapi/v3/playlist/detail`, data, - {crypto: 'linuxapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v3/playlist/detail`, + data, + { + crypto: 'linuxapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/playlist_hot.js b/module/playlist_hot.js index 8e8c25688f5..57cc40e6424 100644 --- a/module/playlist_hot.js +++ b/module/playlist_hot.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/playlist/hottags`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/playlist/hottags`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/playlist_name_update.js b/module/playlist_name_update.js index 12cb602a238..5ce73f19514 100644 --- a/module/playlist_name_update.js +++ b/module/playlist_name_update.js @@ -3,15 +3,18 @@ module.exports = (query, request) => { const data = { id: query.id, - name: query.name + name: query.name, } return request( - 'POST', `http://interface3.music.163.com/eapi/playlist/update/name`, data, + 'POST', + `http://interface3.music.163.com/eapi/playlist/update/name`, + data, { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/playlist/update/name' + url: '/api/playlist/update/name', + realIP: query.realIP, } ) -} \ No newline at end of file +} diff --git a/module/playlist_order_update.js b/module/playlist_order_update.js index 44e5f6d4839..11c512bead7 100644 --- a/module/playlist_order_update.js +++ b/module/playlist_order_update.js @@ -3,10 +3,17 @@ module.exports = (query, request) => { query.cookie.os = 'pc' const data = { - ids: query.ids + ids: query.ids, } return request( - 'POST', `https://music.163.com/api/playlist/order/update`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/playlist/order/update`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/playlist_subscribe.js b/module/playlist_subscribe.js index 9f94b9dba8b..cf9c2aef4c3 100644 --- a/module/playlist_subscribe.js +++ b/module/playlist_subscribe.js @@ -1,12 +1,19 @@ // 收藏与取消收藏歌单 module.exports = (query, request) => { - query.t = (query.t == 1 ? 'subscribe' : 'unsubscribe') + query.t = query.t == 1 ? 'subscribe' : 'unsubscribe' const data = { - id: query.id + id: query.id, } return request( - 'POST', `https://music.163.com/weapi/playlist/${query.t}`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/playlist/${query.t}`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/playlist_subscribers.js b/module/playlist_subscribers.js index 8db788b7b2f..9094f46503c 100644 --- a/module/playlist_subscribers.js +++ b/module/playlist_subscribers.js @@ -4,12 +4,17 @@ module.exports = (query, request) => { const data = { id: query.id, limit: query.limit || 20, - offset: query.offset || 0 - }; + offset: query.offset || 0, + } return request( 'POST', `https://music.163.com/weapi/playlist/subscribers`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ); -}; + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/playlist_tags_update.js b/module/playlist_tags_update.js index 9d812830d05..4b026ed52de 100644 --- a/module/playlist_tags_update.js +++ b/module/playlist_tags_update.js @@ -3,15 +3,18 @@ module.exports = (query, request) => { const data = { id: query.id, - tags: query.tags + tags: query.tags, } return request( - 'POST', `http://interface3.music.163.com/eapi/playlist/tags/update`, data, + 'POST', + `http://interface3.music.163.com/eapi/playlist/tags/update`, + data, { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, - url: '/api/playlist/tags/update' + url: '/api/playlist/tags/update', + realIP: query.realIP, } ) -} \ No newline at end of file +} diff --git a/module/playlist_tracks.js b/module/playlist_tracks.js index b2afe1b382f..17ccb86dd07 100644 --- a/module/playlist_tracks.js +++ b/module/playlist_tracks.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { op: query.op, // del,add pid: query.pid, // 歌单id - trackIds: '[' + query.tracks + ']' // 歌曲id + trackIds: '[' + query.tracks + ']', // 歌曲id } return request( - 'POST', `https://music.163.com/weapi/playlist/manipulate/tracks`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/playlist/manipulate/tracks`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/playlist_update.js b/module/playlist_update.js index 204dd141722..085d195ed70 100644 --- a/module/playlist_update.js +++ b/module/playlist_update.js @@ -7,10 +7,12 @@ module.exports = (query, request) => { const data = { '/api/playlist/desc/update': `{"id":${query.id},"desc":"${query.desc}"}`, '/api/playlist/tags/update': `{"id":${query.id},"tags":"${query.tags}"}`, - '/api/playlist/update/name': `{"id":${query.id},"name":"${query.name}"}` + '/api/playlist/update/name': `{"id":${query.id},"name":"${query.name}"}`, } - return request( - 'POST', `https://music.163.com/weapi/batch`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} - ) -} \ No newline at end of file + return request('POST', `https://music.163.com/weapi/batch`, data, { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }) +} diff --git a/module/playmode_intelligence_list.js b/module/playmode_intelligence_list.js index e91ee7546c2..f8cc7a4d05a 100644 --- a/module/playmode_intelligence_list.js +++ b/module/playmode_intelligence_list.js @@ -6,12 +6,17 @@ module.exports = (query, request) => { type: 'fromPlayOne', playlistId: query.pid, startMusicId: query.sid || query.id, - count: query.count || 1 - }; + count: query.count || 1, + } return request( 'POST', `http://music.163.com/weapi/playmode/intelligence/list`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ); -}; + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/program_recommend.js b/module/program_recommend.js index 3d9295468c2..9302b911798 100644 --- a/module/program_recommend.js +++ b/module/program_recommend.js @@ -4,10 +4,17 @@ module.exports = (query, request) => { const data = { cateId: query.type, limit: query.limit || 10, - offset: query.offset || 0 + offset: query.offset || 0, } return request( - 'POST', `https://music.163.com/weapi/program/recommend/v1`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/program/recommend/v1`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/rebind.js b/module/rebind.js index 7de771312ff..c79d7e13c6e 100644 --- a/module/rebind.js +++ b/module/rebind.js @@ -5,12 +5,17 @@ module.exports = (query, request) => { captcha: query.captcha, phone: query.phone, oldcaptcha: query.oldcaptcha, - ctcode: query.ctcode || '86' - }; + ctcode: query.ctcode || '86', + } return request( 'POST', `https://music.163.com/api/user/replaceCellphone`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } - ); -}; + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } + ) +} diff --git a/module/recommend_resource.js b/module/recommend_resource.js index ce53c526e43..104775d2eb3 100644 --- a/module/recommend_resource.js +++ b/module/recommend_resource.js @@ -2,7 +2,14 @@ module.exports = (query, request) => { return request( - 'POST', `https://music.163.com/weapi/v1/discovery/recommend/resource`, {}, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/v1/discovery/recommend/resource`, + {}, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/recommend_songs.js b/module/recommend_songs.js index efb270d04f3..b88d4576d4c 100644 --- a/module/recommend_songs.js +++ b/module/recommend_songs.js @@ -2,10 +2,16 @@ module.exports = (query, request) => { query.cookie.os = 'ios' - const data = { - } + const data = {} return request( - 'POST', `https://music.163.com/api/v3/discovery/recommend/songs`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/api/v3/discovery/recommend/songs`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/register_cellphone.js b/module/register_cellphone.js index fcb1a982261..e46af3e3f23 100644 --- a/module/register_cellphone.js +++ b/module/register_cellphone.js @@ -7,12 +7,17 @@ module.exports = (query, request) => { captcha: query.captcha, phone: query.phone, password: crypto.createHash('md5').update(query.password).digest('hex'), - nickname: query.nickname + nickname: query.nickname, } return request( 'POST', `https://music.163.com/weapi/register/cellphone`, data, - { crypto: 'weapi', cookie: query.cookie, proxy: query.proxy } + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/related_allvideo.js b/module/related_allvideo.js index 21d9823012b..3de13a91c68 100644 --- a/module/related_allvideo.js +++ b/module/related_allvideo.js @@ -3,10 +3,17 @@ module.exports = (query, request) => { const data = { id: query.id, - type: (/^\d+$/.test(query.id)) ? 0 : 1 + type: /^\d+$/.test(query.id) ? 0 : 1, } return request( - 'POST', `https://music.163.com/weapi/cloudvideo/v1/allvideo/rcmd`, data, - {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + 'POST', + `https://music.163.com/weapi/cloudvideo/v1/allvideo/rcmd`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + } ) -} \ No newline at end of file +} diff --git a/module/related_playlist.js b/module/related_playlist.js index 3e4a540cd11..38ed9cb1c82 100644 --- a/module/related_playlist.js +++ b/module/related_playlist.js @@ -2,31 +2,32 @@ module.exports = (query, request) => { return request( - 'GET', `https://music.163.com/playlist?id=${query.id}`, {}, - {ua: 'pc', cookie: query.cookie, proxy: query.proxy} - ) - .then(response => { - try{ - const pattern = /