diff --git a/CHANGELOG.MD b/CHANGELOG.MD index aabc3fd..738ed47 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,8 @@ # 更新日志 +### 4.11.0 | 2023.09.07 +- 新增 `播客搜索`,`播客上传声音`接口 #1789 + + ### 4.10.2 | 2023.09.04 - 修复docker缺失文件问题 #1791 diff --git a/docs/README.md b/docs/README.md index eb16e37..8210bd6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -270,6 +270,8 @@ 252. 曲风-歌手 253. 私信和通知接口 254. 回忆坐标 +255. 播客搜索 +256. 播客声音上传 ## 安装 @@ -4159,6 +4161,54 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009` **必选参数:** `id` : 歌曲 ID +### 播客列表 + +说明: 可以获取播客列表 + +**接口地址:** `/voicelist/search` + +**可选参数:** + +`limit`: 取出歌单数量 , 默认为 200 + +`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*200, 其中 200 为 limit 的值 + +`podcastName`: 播客名称 + +### 播客上传声音 +说明: 可以上传声音到播客,例子在 `/public/voice_upload.html` 访问地址: /voice_upload.html + +**接口地址:** `/voice/upload` + +**必选参数:** +`voiceListId`: 播客 id + +`coverImgId`: 播客封面 + +`categoryId`: 分类id + +`secondCategoryId`:次级分类id + +`description`: 声音介绍 + + +**可选参数:** +`songName`: 声音名称 + +`privacy`: 设为隐私声音,播客如果是隐私博客,则必须设为1 + +`publishTime`:默认立即发布,定时发布的话需传入时间戳 + +`autoPublish`: 是否发布动态,是则传入1 + +`autoPublishText`: 动态文案 + +`orderNo`: 排序,默认为1 + +`composedSongs`: 包含歌曲(歌曲id),多个用逗号隔开 + + + ## 离线访问此文档 此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问 diff --git a/module/voice_upload.js b/module/voice_upload.js index 116f23d..b340348 100644 --- a/module/voice_upload.js +++ b/module/voice_upload.js @@ -19,9 +19,8 @@ module.exports = async (query, request) => { if (query.songFile.name.indexOf('flac') > -1) { ext = 'flac' } - const filename = - query.filename || + query.songName || query.songFile.name .replace('.' + ext, '') .replace(/\s/g, '') @@ -102,19 +101,20 @@ module.exports = async (query, request) => { voiceData: JSON.stringify([ { name: filename, - autoPublish: true, - autoPublishText: '', + autoPublish: query.autoPublish == 1 ? true : false, + autoPublishText: query.autoPublishText || '', description: query.description, - // 换成自己的 voiceListId: query.voiceListId, coverImgId: query.coverImgId, dfsId: docId, categoryId: query.categoryId, secondCategoryId: query.secondCategoryId, - composedSongs: [], - privacy: true, - publishTime: 0, - orderNo: 1, + composedSongs: query.composedSongs + ? query.composedSongs.split(',') + : [], + privacy: query.privacy == 1 ? true : false, + publishTime: query.publishTime || 0, + orderNo: query.orderNo || 1, }, ]), }, @@ -135,19 +135,20 @@ module.exports = async (query, request) => { voiceData: JSON.stringify([ { name: filename, - autoPublish: true, - autoPublishText: '', + autoPublish: query.autoPublish == 1 ? true : false, + autoPublishText: query.autoPublishText || '', description: query.description, - // 换成自己的 - voiceListId: query.voiceListId || 994681645, + voiceListId: query.voiceListId, coverImgId: query.coverImgId, dfsId: docId, categoryId: query.categoryId, - secondCategoryId: query.secondCategoryId || 466050, - composedSongs: [], - privacy: true, - publishTime: 0, - orderNo: 1, + secondCategoryId: query.secondCategoryId, + composedSongs: query.composedSongs + ? query.composedSongs.split(',') + : [], + privacy: query.privacy == 1 ? true : false, + publishTime: query.publishTime || 0, + orderNo: query.orderNo || 1, }, ]), }, diff --git a/module/voicelist_search.js b/module/voicelist_search.js index 46fb708..ebf236b 100644 --- a/module/voicelist_search.js +++ b/module/voicelist_search.js @@ -1,8 +1,9 @@ module.exports = (query, request) => { const data = { fee: '-1', - limit: '200', - podcastName: '', + limit: query.limit || '200', + offset: query.offset || '0', + podcastName: query.podcastName || '', } return request( 'POST', diff --git a/package.json b/package.json index b18c8a8..b7aaedc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.10.2", + "version": "4.11.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/public/audio_upload.html b/public/audio_upload.html deleted file mode 100644 index a5a662c..0000000 --- a/public/audio_upload.html +++ /dev/null @@ -1,84 +0,0 @@ - - -
- - -