From f268e7b87068de238e6e9e5cd9fcf48e0be15aa5 Mon Sep 17 00:00:00 2001 From: Kengwang Date: Mon, 16 Jan 2023 00:22:24 +0800 Subject: [PATCH] =?UTF-8?q?[feat]:=20=E4=B8=80?= =?UTF-8?q?=E8=B5=B7=E5=90=AC=20API=20=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 见 #1676 --- module/listentogether_end.js | 20 +++++++++++ module/listentogether_heatbeat.js | 23 +++++++++++++ module/listentogether_play_command.js | 28 ++++++++++++++++ module/listentogether_room_check.js | 20 +++++++++++ module/listentogether_room_create.js | 20 +++++++++++ ...her_status.js => listentogether_status.js} | 0 module/listentogether_sync_list_command.js | 33 +++++++++++++++++++ module/listentogether_sync_playlist_get.js | 20 +++++++++++ 8 files changed, 164 insertions(+) create mode 100644 module/listentogether_end.js create mode 100644 module/listentogether_heatbeat.js create mode 100644 module/listentogether_play_command.js create mode 100644 module/listentogether_room_check.js create mode 100644 module/listentogether_room_create.js rename module/{listen_together_status.js => listentogether_status.js} (100%) create mode 100644 module/listentogether_sync_list_command.js create mode 100644 module/listentogether_sync_playlist_get.js 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..5b20d4b --- /dev/null +++ b/module/listentogether_play_command.js @@ -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' + }, + ) + } + \ No newline at end of file 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