Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #863 from greenhat616/master
Browse files Browse the repository at this point in the history
feat: optional realIP
  • Loading branch information
Binaryify authored Aug 8, 2020
2 parents 31d7e39 + 3c638e5 commit 9063c7d
Show file tree
Hide file tree
Showing 178 changed files with 1,734 additions and 906 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ node_modules

.idea/
package-lock.json
yarn.lock

.vscode
11 changes: 6 additions & 5 deletions module/activate_init_profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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',
}
);
};
)
}
13 changes: 10 additions & 3 deletions module/album.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
}
9 changes: 6 additions & 3 deletions module/album_detail.js
Original file line number Diff line number Diff line change
@@ -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,
}
)
}
}
9 changes: 7 additions & 2 deletions module/album_detail_dynamic.js
Original file line number Diff line number Diff line change
@@ -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,
}
)
}
15 changes: 11 additions & 4 deletions module/album_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
}
13 changes: 10 additions & 3 deletions module/album_list_style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
}
14 changes: 8 additions & 6 deletions module/album_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
}
return request('POST', `https://music.163.com/weapi/album/new`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
11 changes: 9 additions & 2 deletions module/album_newest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
7 changes: 6 additions & 1 deletion module/album_songsaleboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
13 changes: 7 additions & 6 deletions module/album_sub.js
Original file line number Diff line number Diff line change
@@ -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,
})
}
14 changes: 8 additions & 6 deletions module/album_sublist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
}
return request('POST', `https://music.163.com/weapi/album/sublist`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
15 changes: 11 additions & 4 deletions module/artist_album.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
}
15 changes: 11 additions & 4 deletions module/artist_desc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
}
}
18 changes: 11 additions & 7 deletions module/artist_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
}
return request('POST', `https://music.163.com/api/v1/artist/list`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
14 changes: 8 additions & 6 deletions module/artist_mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
}
return request('POST', `https://music.163.com/weapi/artist/mvs`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
17 changes: 12 additions & 5 deletions module/artist_sub.js
Original file line number Diff line number Diff line change
@@ -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,
}
)
}
}
14 changes: 8 additions & 6 deletions module/artist_sublist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
}
return request('POST', `https://music.163.com/weapi/artist/sublist`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
14 changes: 8 additions & 6 deletions module/artist_top_song.js
Original file line number Diff line number Diff line change
@@ -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}
)
}
return request('POST', `https://music.163.com/api/artist/top/song`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
Loading

0 comments on commit 9063c7d

Please sign in to comment.