mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-29 18:06:31 +08:00
fix: some bugs in 色花堂 (#3968)
This commit is contained in:
@@ -21,18 +21,13 @@ const forumIdMaps = {
|
||||
module.exports = async (ctx) => {
|
||||
const subformName = ctx.params.subforumid || 'gqzwzm';
|
||||
const subformId = subformName in forumIdMaps ? forumIdMaps[subformName] : subformName;
|
||||
const typefilter = ctx.params.type ? `&filter=type&typeid=${ctx.params.type}` : '';
|
||||
const typefilter = ctx.params.type ? `&filter=typeid&typeid=${ctx.params.type}` : '';
|
||||
const link = `${host}forum.php?mod=forumdisplay&fid=${subformId}${typefilter}`;
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const list = $('#threadlisttableid tbody')
|
||||
.slice(1, 21)
|
||||
.filter(function() {
|
||||
// 去除置顶帖子和分割线
|
||||
const threadID = $(this).attr('id');
|
||||
return typeof threadID !== 'undefined' && threadID !== 'separatorline' && !threadID.startsWith('stickthread');
|
||||
})
|
||||
const list = $('#threadlisttableid tbody[id^=normalthread]')
|
||||
.slice(0, 11)
|
||||
.map(function() {
|
||||
const info = {
|
||||
title:
|
||||
|
||||
Reference in New Issue
Block a user