diff --git a/docs/README.md b/docs/README.md index ac8c52d1a2..324304f175 100644 --- a/docs/README.md +++ b/docs/README.md @@ -864,11 +864,11 @@ GitHub 官方也提供了一些 RSS: ### 腾讯视频 - + ### 喜马拉雅 - + ::: warning 注意 专辑 id 是跟在**分类拼音**后的那个 id, 不要输成某集的 id 了 @@ -1111,7 +1111,7 @@ GitHub 官方也提供了一些 RSS: ### 看漫画 - + ### Anime1 @@ -1213,7 +1213,7 @@ GitHub 官方也提供了一些 RSS: ### Apkpure - + ## 大学通知 @@ -1461,7 +1461,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet ::: - + | 全部 | 文件公告 | 学术报告 | 招标信息 | 会议通知 | 党政事务 | 组织人事 | | ---- | -------- | -------- | -------- | -------- | -------- | -------- | @@ -1477,17 +1477,17 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet ::: - + - + | 学院新闻 | 学生工作 | 通知公告 | 教务通知 | 科研动态 | 招生就业 | | -------- | -------- | -------- | -------- | -------- | -------- | | 2242 | 2237 | 2245 | 2246 | 2243 | 2244 | - + - + | 通知公告 | 教学新闻 | 规章制度 | 教学研究 | 教务管理 | 考试中心 | | -------- | -------- | -------- | -------- | -------- | -------- | @@ -1497,35 +1497,35 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet | -------- | -------- | -------- | -------- | -------- | -------- | | 8 | 9 | 56 | 60 | 62 | 43 | - + - + | 招生工作 | 培养工作 | 学位工作 | 学生工作 | 就业工作 | 国际合作 | 文件下载 | 工作动态 | 通知公告 | | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | - + - + - + | 通知公告 | 新闻快讯 | 学术动态 | 学生工作 | 研究生教育 | 本科教育 | | -------- | -------- | -------- | -------- | ---------- | -------- | | 11 | 10 | 12 | 6 | 4 | 3 | - + - + | 信息公告 | 新闻快讯 | 科学研究 | 网上公示 | 本科教育 | 研究生教育 | | -------- | -------- | -------- | -------- | -------- | ---------- | | 12 | 11 | 3 | 110 | 4 | 5 | - + - + ::: tip 提示 @@ -1535,11 +1535,11 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet ::: - + ### 成都信息工程大学 - + | 综合新闻 | 信息公告 | 焦点新闻 | 学术动态 | 工作交流 | 媒体成信 | 更名专题 | 文化活动 | | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | @@ -1585,7 +1585,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet ### 南京理工大学 - + | 教师通知 | 学生通知 | 新闻 | 学院动态 | | -------- | -------- | ---- | -------- | @@ -1593,7 +1593,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet - + | 新闻及通知 | 办事指南 | | ---------- | -------- | @@ -1601,7 +1601,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet - + | 通知公告 | 学术公告 | | -------- | -------- | @@ -1625,6 +1625,8 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet | -------- | -------- | | 13 | 14 | + + @@ -1733,6 +1735,8 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet | :--: | :------: | :------: | :------: | :------: | :------: | :------: | :------: | | all | xxfb | tzgg | jwxx | jxyj | jxsj | zsxx | zljk | + + ### 东莞理工学院 @@ -2079,7 +2083,7 @@ ISO 3166-1 国家代码列表请参见 [维基百科 ISO_3166-1](https://zh.wiki ### iMuseum - + | 全部 | 最新 | 热门 | 即将结束 | 即将开始 | 已结束 | | ---- | ------ | ---- | -------- | -------- | -------- | @@ -2127,8 +2131,6 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运 ::: - - @@ -2294,6 +2296,7 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运 ### Steam + 参数 params 请从 Steam 的 URL 取得 Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 params 是 `specials=1&term=atelier`,将它填入 RSSHub 的路由就好 @@ -2317,6 +2320,7 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 由于笔趣阁网站有多个, 各站点小说对应的小说 id 不同. 此 feed 只对应在[`www.biquge5200.com`](https://www.biquge5200.com/)中的小说 id. ::: + ### UU 看书 @@ -2714,6 +2718,7 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 ### 经济观察网 + category 对应的关键词有 | 时事 | 政策 | 证券 | 资本 | 理财 | 新科技 | 大健康 | 房产 | 汽车 | 消费 | 影视 | 娱乐 | 体育 | 教育 | 观察家 | 专栏 | 书评 | 个人历史 | 宏观 | diff --git a/docs/joinus/README.md b/docs/joinus/README.md index 43442280a2..bd529d3587 100644 --- a/docs/joinus/README.md +++ b/docs/joinus/README.md @@ -338,7 +338,7 @@ ctx.state.data = { image: '', // 专辑图片, 作为播客源时必填 item: [ { - itunes_item_image: '', // 图像 + itunes_item_image: '', // 每个track单独的图片 enclosure_url: '', // 音频链接 enclosure_length: '', // 时间戳 (播放长度) , 一般是秒数,可选 enclosure_type: '', // [.mp3就填'audio/mpeg'] [.m4a就填'audio/x-m4a'] [.mp4就填'video/mp4'], 或其他类型. @@ -484,6 +484,8 @@ ctx.state.data = { *** +1. 请一定要注意把``的标签关闭! + 1. 执行 `npm run format` 自动标准化代码格式,提交代码, 然后提交 pull request --- diff --git a/lib/router.js b/lib/router.js index a81f6163ec..d37fc8d4d9 100644 --- a/lib/router.js +++ b/lib/router.js @@ -365,8 +365,7 @@ router.get('/3dm/news', require('./routes/3dm/news_center')); router.get('/lfsyd/:typecode', require('./routes/lfsyd/index')); // 喜马拉雅 -router.get('/ximalaya/album/:classify/:id', require('./routes/ximalaya/album')); -router.get('/ximalaya/album/:id', require('./routes/ximalaya/album')); +router.get('/ximalaya/album/:id/:all?', require('./routes/ximalaya/album')); // EZTV router.get('/eztv/torrents/:imdb_id', require('./routes/eztv/imdb')); diff --git a/lib/routes/ximalaya/album.js b/lib/routes/ximalaya/album.js index 77f2a06e4f..1c442f82b5 100644 --- a/lib/routes/ximalaya/album.js +++ b/lib/routes/ximalaya/album.js @@ -4,8 +4,8 @@ const axios_ins = axios.create({}); module.exports = async (ctx) => { const id = ctx.params.id; // 专辑id - - const TrackInfoApi = 'http://mobile.ximalaya.com/v1/track/baseInfo?device=android&trackId='; + const isAll = ctx.params.all ? true : false; + const pageSize = isAll ? 200 : 30; const AlbumInfoApi = `https://www.ximalaya.com/revision/album?albumId=${id}`; // 专辑数据的API const AlbumInfoResponse = await axios_ins.get(AlbumInfoApi); @@ -23,46 +23,49 @@ module.exports = async (ctx) => { const albumUrl = '/' + classify + '/' + id + '/'; // 某分类的链接 const ispaid = albuminfo.isPaid; // 是否需要付费 - const tracksinfo = AlbumInfoResponse.data.data.tracksInfo; // 专辑数据 - const playList = tracksinfo.tracks; + const TrackInfoApi = `http://mobile.ximalaya.com/mobile/v1/album/track/?albumId=${id}&pageSize=${pageSize}&pageId=`; + const TrackInfoResponse = await axios_ins.get(TrackInfoApi + 1); + const maxPageId = TrackInfoResponse.data.data.maxPageId; // 专辑数据 + + let playList = TrackInfoResponse.data.data.list; + + if (isAll) { + const promises = []; + for (let i = 2; i <= maxPageId; i++) { + promises.push(axios_ins.get(TrackInfoApi + i)); + } + const responses = await Promise.all(promises); + for (let j = 0; j < responses.length; j++) { + playList = playList.concat(responses[j].data.data.list); + } + } const resultItems = await Promise.all( playList.map(async (item) => { const title = item.title; const trackId = item.trackId; - const trackUrl = item.url; - const link = baseUrl + trackUrl; + const itunes_item_image = item.coverLarge ? item.coverLarge : album_cover; + const link = baseUrl + albumUrl + trackId; + const pubDate = new Date(item.createdAt).toUTCString(); + const enclosure_length = item.duration; // 时间长度:单位(秒) + const enclosure_url = item.playPathAacv224; - let resultItem = {}; - const value = await ctx.cache.get(link); - if (value) { - resultItem = JSON.parse(value); - } else { - const track = await axios_ins.get(TrackInfoApi + trackId); - const track_item = track.data; - const enclosure_length = track_item.duration; // 时间长度:单位(秒) + let desc = '请在网页查看声音简介:' + `${link}`; - let desc = track_item.intro ? track_item.intro.replace(/((\r\n)+(\s)?)+/g, '
') : '暂无简介'; - const itunes_item_image = track_item.coverLarge ? track_item.coverLarge.split('!')[0] : albuminfo.cover.split('!')[0]; - - if (ispaid) { - desc = desc + '
' + ' [付费内容请打开网页收听] : ' + `${link}`; - } - - resultItem = { - title: title, - link: link, - description: desc, - pubDate: new Date(track_item.createdAt).toUTCString(), - itunes_item_image: itunes_item_image, - enclosure_url: track_item.playPathAacv224, - enclosure_length: enclosure_length, - enclosure_type: 'audio/x-m4a', - }; - - ctx.cache.set(link, JSON.stringify(resultItem), 24 * 60 * 60); + if (ispaid) { + desc = ' [该内容需付费,请打开网页收听] ' + '
' + desc; } + const resultItem = { + title: title, + link: link, + description: desc, + pubDate: pubDate, + itunes_item_image: itunes_item_image, + enclosure_url: enclosure_url, + enclosure_length: enclosure_length, + enclosure_type: 'audio/x-m4a', + }; return Promise.resolve(resultItem); }) );