* issues #1019 的迫真修复 * 修复 issues #1019 * 修复 issues #1019 * 改回 pickedLyric() 逻辑 * 更进一步的避免取词卡死问题 * 更新网易云 api 到 4.2.0 * Update README.md * Revert "Update README.md" This reverts commit b862ef7d4dabd40c8fe57e4837fc6220806a1456.master
parent
8341727882
commit
0d3df4a1e4
@ -0,0 +1,24 @@
|
||||
// 歌手相关视频
|
||||
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
artistId: query.id,
|
||||
page: JSON.stringify({
|
||||
size: query.size || 10,
|
||||
cursor: query.cursor || 0,
|
||||
}),
|
||||
tab: 0,
|
||||
order: query.order || 0,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/weapi/mlog/artist/video`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
const { resourceTypeMap } = require('../util/config.json')
|
||||
// 发送与删除评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
query.t = {
|
||||
1: 'add',
|
||||
0: 'delete',
|
||||
2: 'reply',
|
||||
}[query.t]
|
||||
query.type = resourceTypeMap[query.type]
|
||||
const data = {
|
||||
threadId: query.type + query.id,
|
||||
}
|
||||
|
||||
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
|
||||
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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// 专辑评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// 电台评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
const { resourceTypeMap } = require('../util/config.json')
|
||||
module.exports = (query, request) => {
|
||||
query.type = resourceTypeMap[query.type]
|
||||
const data = {
|
||||
parentCommentId: query.parentCommentId,
|
||||
threadId: query.type + query.id,
|
||||
time: query.time || -1,
|
||||
limit: query.limit || 20,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/resource/comment/floor/get`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
const { resourceTypeMap } = require('../util/config.json')
|
||||
// 热门评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
query.type = resourceTypeMap[query.type]
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
const { resourceTypeMap } = require('../util/config.json')
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'ios'
|
||||
query.cookie.appver = '8.1.20'
|
||||
query.type = resourceTypeMap[query.type || 0]
|
||||
const threadId = query.type + query.sid
|
||||
const data = {
|
||||
targetUserId: query.uid,
|
||||
commentId: query.cid,
|
||||
cursor: query.cursor || '-1',
|
||||
threadId: threadId,
|
||||
pageNo: query.page || 1,
|
||||
idCursor: query.idCursor || -1,
|
||||
pageSize: query.pageSize || 100,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/v2/resource/comments/hug/list`,
|
||||
data,
|
||||
{
|
||||
crypto: 'api',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
const { resourceTypeMap } = require('../util/config.json')
|
||||
// 点赞与取消点赞评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
query.t = query.t == 1 ? 'like' : 'unlike'
|
||||
query.type = resourceTypeMap[query.type]
|
||||
const data = {
|
||||
threadId: query.type + query.id,
|
||||
commentId: query.cid,
|
||||
}
|
||||
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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// 歌曲评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// MV评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
const { resourceTypeMap } = require('../util/config.json')
|
||||
// 评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
query.type = resourceTypeMap[query.type]
|
||||
const threadId = query.type + query.id
|
||||
const pageSize = query.pageSize || 20
|
||||
const pageNo = query.pageNo || 1
|
||||
const data = {
|
||||
threadId: threadId,
|
||||
pageNo,
|
||||
showInner: query.showInner || true,
|
||||
pageSize,
|
||||
cursor:
|
||||
+query.sortType === 3 ? query.cursor || '0' : (pageNo - 1) * pageSize,
|
||||
sortType: query.sortType || 1, //1:按推荐排序,2:按热度排序,3:按时间排序
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/v2/resource/comments`,
|
||||
data,
|
||||
{
|
||||
crypto: 'eapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
url: '/api/v2/resource/comments',
|
||||
},
|
||||
)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// 歌单评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// 视频评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
rid: query.id,
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 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,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
// 通过传过来的歌单id拿到所有歌曲数据
|
||||
// 支持传递参数limit来限制获取歌曲的数据数量 例如: /playlist/track/all?id=7044354223&limit=10
|
||||
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
id: query.id,
|
||||
n: 100000,
|
||||
s: query.s || 8,
|
||||
}
|
||||
//不放在data里面避免请求带上无用的数据
|
||||
let limit = query.limit
|
||||
let trackIds
|
||||
let idsData = Object.create(null)
|
||||
|
||||
return request('POST', `https://music.163.com/api/v6/playlist/detail`, data, {
|
||||
crypto: 'api',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
}).then((res) => {
|
||||
const ids = []
|
||||
let trackIds = res.body.playlist.trackIds
|
||||
if (typeof limit === 'undefined') {
|
||||
limit = trackIds.length
|
||||
}
|
||||
trackIds.forEach((item, index) => {
|
||||
if (index < limit) {
|
||||
ids.push(item.id)
|
||||
}
|
||||
})
|
||||
idsData = {
|
||||
c: '[' + ids.map((id) => '{"id":' + id + '}').join(',') + ']',
|
||||
}
|
||||
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/v3/song/detail`,
|
||||
idsData,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
})
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
// 获取动态评论
|
||||
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || 20,
|
||||
offset: query.offset || 0,
|
||||
beforeTime: query.before || 0,
|
||||
limit: query.limit || 100,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/weapi/v1/resource/comments/${query.threadId}`,
|
||||
`https://music.163.com/api/play-record/album/list`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
@ -0,0 +1,16 @@
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || 100,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/play-record/playlist/list`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || 100,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/play-record/song/list`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || 100,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/play-record/newvideo/list`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
limit: query.limit || 100,
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/play-record/voice/list`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// 获取客户端歌曲下载链接
|
||||
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
id: query.id,
|
||||
br: parseInt(query.br || 999000),
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://interface.music.163.com/eapi/song/enhance/download/url`,
|
||||
data,
|
||||
{
|
||||
crypto: 'eapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
url: '/api/song/enhance/download/url',
|
||||
},
|
||||
)
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>home</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js"></script>
|
||||
<script>
|
||||
const phone = '' // 这里填手机号
|
||||
const password = '' // 这里填密码
|
||||
const fileUpdateTime = {}
|
||||
let cookieToken = ''
|
||||
if (!phone || !password) {
|
||||
const msg = '请设置你的手机号码和密码'
|
||||
alert(msg)
|
||||
throw new Error(msg)
|
||||
}
|
||||
|
||||
async function login() {
|
||||
const res = await axios({
|
||||
url: `/login/cellphone?phone=${phone}&password=${encodeURIComponent(
|
||||
password,
|
||||
)}`,
|
||||
})
|
||||
cookieToken = res.data.cookie
|
||||
}
|
||||
async function main() {
|
||||
await login()
|
||||
const res = await axios({
|
||||
url: `/homepage/block/page`,
|
||||
data: {
|
||||
cookie: cookieToken,
|
||||
},
|
||||
method: 'post',
|
||||
})
|
||||
let cursor = ''
|
||||
console.log(res.data.data)
|
||||
if (res.data.data.hasMore) {
|
||||
cursor = res.data.data.cursor
|
||||
const res2 = await axios({
|
||||
url: `/homepage/block/page?time=${Date.now()}`,
|
||||
data: {
|
||||
cookie: cookieToken,
|
||||
cursor: cursor,
|
||||
},
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
}
|
||||
main()
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>登录</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js"></script>
|
||||
<script>
|
||||
const phone = '' // 这里填手机号
|
||||
const password = '' // 这里填密码
|
||||
const fileUpdateTime = {}
|
||||
if (!phone || !password) {
|
||||
const msg = '请设置你的手机号码和密码'
|
||||
alert(msg)
|
||||
throw new Error(msg)
|
||||
}
|
||||
|
||||
async function login() {
|
||||
const res = await axios({
|
||||
url: `/login/cellphone`,
|
||||
method: 'post',
|
||||
data: {
|
||||
phone: phone,
|
||||
password: password,
|
||||
},
|
||||
})
|
||||
return res.data.cookie
|
||||
}
|
||||
async function main() {
|
||||
const cookieToken = await login()
|
||||
const res = await axios({
|
||||
url: `/login/status`,
|
||||
method: 'post',
|
||||
data: {
|
||||
cookie: cookieToken,
|
||||
},
|
||||
})
|
||||
}
|
||||
main()
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in new issue