diff --git a/docs/README.md b/docs/README.md index e24fcf4..0192516 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3561,6 +3561,14 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` 一起听相关参见此 Issue: [#1676](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1676) +主机模式: + +代码可参考: 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_play_command.js b/module/listentogether_play_command.js index 5b20d4b..e236af4 100644 --- a/module/listentogether_play_command.js +++ b/module/listentogether_play_command.js @@ -1,28 +1,27 @@ -// 一起听 发送播放状态 - -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' - }, - ) - } - \ No newline at end of file +// 一起听 发送播放状态 + +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/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 @@ + + + + + + + + 一起听 - 主机模式 + + + + + + + +

一起听 - 主机模式

+
消息: {{message}}
+ +
+
+ +
您的当前登录账号为: {{account.nickname}}
+
+
+ + +
+
分享链接为: + https://st.music.163.com/listen-together/share/?songId=1372188635&roomId={{roomInfo.roomId}}&inviterId={{account.userId}} +
+
+ +
在线用户:
+ + +
+
+ + + +
+ 播放列表 +
+
歌单ID:
+ + {{playlistInfo.playlistName}} +
+
+
歌单内容:
+ +
+ + + + +