diff --git a/docs/README.md b/docs/README.md index e439aac48..ba8607c8f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -835,7 +835,9 @@ GitHub 官方也提供了一些 RSS: ### 草榴社区 - + + +> 注意:并非所欲的分区都有子类型,可以参考成人文学交流区的[古典武侠]这一子类型。 | 亚洲无码原创区 | 亚洲有码原创区 | 欧美原创区 | 动漫原创区 | 国产原创区 | | -------------- | -------------- | ---------- | ---------- | ---------- | @@ -845,9 +847,9 @@ GitHub 官方也提供了一些 RSS: | ---------- | ---------- | ----------- | ---------- | | 26 | 27 | 21 | 22 | -| 技术讨论区 | 新时代的我们 | 达盖尔的旗帜 | -| ---------- | ------------ | ------------ | -| 7 | 8 | 16 | +| 技术讨论区 | 新时代的我们 | 达盖尔的旗帜 | 成人文学交流 | +| ---------- | ------------ | ------------ | ------------ | +| 7 | 8 | 16 | 20 | diff --git a/router.js b/router.js index 13677e0e8..1e1f80531 100644 --- a/router.js +++ b/router.js @@ -366,7 +366,7 @@ router.get('/cctv/:category', require('./routes/cctv/category')); router.get('/caixin/:column/:category', require('./routes/caixin/category')); // 草榴社区 -router.get('/t66y/:id', require('./routes/t66y/index')); +router.get('/t66y/:id/:type?', require('./routes/t66y/index')); // 机核 router.get('/gcores/category/:category', require('./routes/gcores/category')); diff --git a/routes/t66y/index.js b/routes/t66y/index.js index 1a5487a4b..7c67333bd 100644 --- a/routes/t66y/index.js +++ b/routes/t66y/index.js @@ -34,9 +34,11 @@ const sourceTimezoneOffset = -8; const filterReg = /read\.php/; module.exports = async (ctx) => { - const res = await axios_ins.get(url.resolve(base, `${section}${ctx.params.id}&search=today`)); + const typefilter = ctx.params.type ? `&type=${ctx.params.type}` : ''; + const res = await axios_ins.get(url.resolve(base, `${section}${ctx.params.id}${typefilter}&search=today`)); const data = iconv.decode(res.data, 'gbk'); const $ = cheerio.load(data); + const typeTitle = ctx.params.type ? `[${$('.t .fn b').text()}]` : ''; let list = $('#ajaxtable > tbody:nth-child(2)'); list = $('.tr2', list) .not('.tr2.tac') @@ -57,7 +59,7 @@ module.exports = async (ctx) => { // Change the image tag to display image in rss reader try { - $ = cheerio.load(content); + $ = cheerio.load(content, { decodeEntities: false }); // 修复无发进行filter与filterout的问题 } catch (error) { return null; } @@ -92,7 +94,7 @@ module.exports = async (ctx) => { } return { - description: $.html(), + description: $('body').html(), pubDate: time.toUTCString(), }; }; @@ -115,6 +117,11 @@ module.exports = async (ctx) => { return Promise.resolve(JSON.parse(cache)); } + const tnode = $('.tal') + .contents() + .get(0); + const catalog = tnode.type === 'text' ? tnode.data.trim() : ''; + if ( cheerio .load(title)('font') @@ -132,7 +139,7 @@ module.exports = async (ctx) => { } const single = { - title: title, + title: `${catalog} ${title}`, link: link, guid: path, }; @@ -156,8 +163,8 @@ module.exports = async (ctx) => { ); ctx.state.data = { - title: $('title').text(), - link: url.resolve(base, `${section}${ctx.params.id}`), + title: typeTitle + $('title').text(), + link: url.resolve(base, `${section}${ctx.params.id}${typefilter}`), item: out.filter((item) => item !== ''), }; };