diff --git a/docs/README.md b/docs/README.md index 2f78e55..0786449 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3574,13 +3574,17 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **调用例子 :** `/artist/new/mv?limit=1` `/artist/new/mv?limit=1&before=1602777625000` -### 一起听状态 +### 一起听相关 -说明 :登录后调用此接口可获取一起听状态 +一起听相关参见此 Issue: [#1676](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1676) -**接口地址 :** `/listen/together/status` +主机模式: -**调用例子 :** `/listen/together/status` +代码可参考: https://github.com/Binaryify/NeteaseCloudMusicApi/blob/master/public/listen_together_host.html + +访问地址: http://localhost:3000/listen_together_host.html + +从机模式: 待整理 ### batch 批量请求接口 diff --git a/module/listentogether_end.js b/module/listentogether_end.js new file mode 100644 index 0000000..c4611b6 --- /dev/null +++ b/module/listentogether_end.js @@ -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' + }, + ) + } + \ No newline at end of file diff --git a/module/listentogether_heatbeat.js b/module/listentogether_heatbeat.js new file mode 100644 index 0000000..3e21da9 --- /dev/null +++ b/module/listentogether_heatbeat.js @@ -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' + }, + ) + } + \ No newline at end of file diff --git a/module/listentogether_play_command.js b/module/listentogether_play_command.js new file mode 100644 index 0000000..e236af4 --- /dev/null +++ b/module/listentogether_play_command.js @@ -0,0 +1,27 @@ +// 一起听 发送播放状态 + +module.exports = (query, request) => { + const data = { + roomId: query.roomId, + commandInfo: JSON.stringify({ + 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', + }, + ) +} diff --git a/module/listentogether_room_check.js b/module/listentogether_room_check.js new file mode 100644 index 0000000..4780529 --- /dev/null +++ b/module/listentogether_room_check.js @@ -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' + }, + ) + } + \ No newline at end of file diff --git a/module/listentogether_room_create.js b/module/listentogether_room_create.js new file mode 100644 index 0000000..7f25325 --- /dev/null +++ b/module/listentogether_room_create.js @@ -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' + }, + ) + } + \ No newline at end of file diff --git a/module/listen_together_status.js b/module/listentogether_status.js similarity index 100% rename from module/listen_together_status.js rename to module/listentogether_status.js diff --git a/module/listentogether_sync_list_command.js b/module/listentogether_sync_list_command.js new file mode 100644 index 0000000..e2d9bb6 --- /dev/null +++ b/module/listentogether_sync_list_command.js @@ -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' + }, + ) + } + \ No newline at end of file diff --git a/module/listentogether_sync_playlist_get.js b/module/listentogether_sync_playlist_get.js new file mode 100644 index 0000000..1485910 --- /dev/null +++ b/module/listentogether_sync_playlist_get.js @@ -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' + }, + ) + } + \ No newline at end of file diff --git a/public/listen_together_host.html b/public/listen_together_host.html new file mode 100644 index 0000000..4c40a11 --- /dev/null +++ b/public/listen_together_host.html @@ -0,0 +1,242 @@ + + + + +
+ + +