[feat]<api/listentogether>: 一起听 API 相关

#1676
This commit is contained in:
Kengwang 2023-01-16 00:22:24 +08:00 committed by GitHub
parent d73effd34a
commit f268e7b870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,20 @@
// 一起听 结束房间
module.exports = (query, request) => {
const data = {
roomId: query.roomId
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/end/v2`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/end/v2'
},
)
}

View File

@ -0,0 +1,23 @@
// 一起听 发送心跳
module.exports = (query, request) => {
const data = {
roomId: query.roomId,
songId: query.songId,
playStatus: query.playStatus,
progress: query.progress
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/heartbeat`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/heartbeat'
},
)
}

View File

@ -0,0 +1,28 @@
// 一起听 发送播放状态
module.exports = (query, request) => {
const data = {
roomId: query.roomId,
commandInfo: {
commandType: query.commandType,
progress: query.progress || 0,
playStatus: query.playStatus,
formerSongId: query.formerSongId,
targetSongId: query.targetSongId,
clientSeq: query.clientSeq
}
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/play/command/report`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/play/command/report'
},
)
}

View File

@ -0,0 +1,20 @@
// 一起听 房间情况
module.exports = (query, request) => {
const data = {
roomId: query.roomId
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/room/check`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/room/check'
},
)
}

View File

@ -0,0 +1,20 @@
// 一起听创建房间
module.exports = (query, request) => {
const data = {
refer: 'songplay_more'
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/room/create`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/room/create'
},
)
}

View File

@ -0,0 +1,33 @@
// 一起听 更新播放列表
module.exports = (query, request) => {
const data = {
roomId: query.roomId,
playlistParam: JSON.stringify({
commandType: query.commandType,
version: [
{
userId: query.userId,
version: query.version
}
],
anchorSongId: '',
anchorPosition: -1,
randomList: query.randomList.split(','),
displayList: query.displayList.split(',')
})
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/sync/list/command/report`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/sync/list/command/report'
},
)
}

View File

@ -0,0 +1,20 @@
// 一起听 当前列表获取
module.exports = (query, request) => {
const data = {
roomId: query.roomId
}
return request(
'POST',
`http://interface.music.163.com/eapi/listen/together/sync/playlist/get`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/listen/together/sync/playlist/get'
},
)
}