diff --git a/lib/v2/ft/maintainer.js b/lib/v2/ft/maintainer.js index cdbeeec836..3aa6462681 100644 --- a/lib/v2/ft/maintainer.js +++ b/lib/v2/ft/maintainer.js @@ -1,4 +1,4 @@ module.exports = { - '/ft/myft/:key': ['HenryQW'], - '/ft/:language/:channel?': ['HenryQW', 'xyqfer'], + '/myft/:key': ['HenryQW'], + '/:language/:channel?': ['HenryQW', 'xyqfer'], }; diff --git a/lib/v2/ft/utils.js b/lib/v2/ft/utils.js index 1e6a15378f..886a43392e 100644 --- a/lib/v2/ft/utils.js +++ b/lib/v2/ft/utils.js @@ -2,9 +2,9 @@ const got = require('@/utils/got'); const parser = require('@/utils/rss-parser'); const cheerio = require('cheerio'); -const ProcessFeed = ($, link) => { +const ProcessFeed = (i, $, link) => { const title = $('h1').text(); - let content = $('div.story-container'); + let content = $('div.story-container').eq(i); // 处理封面图片 content.find('div.story-image > figure').each((_, e) => { @@ -59,17 +59,20 @@ const getData = async ({ site = 'www', channel, ctx }) => { } const items = await Promise.all( - feed.items.splice(0, 10).map((item) => { + feed.items.map((item) => { item.link = item.link.replace('http://', 'https://'); return ctx.cache.tryGet(item.link, async () => { const response = await got.get(`${item.link}?full=y&archive`); const $ = cheerio.load(response.data); - const result = ProcessFeed($, item.link); + const results = []; + for (let i = 0; i < $('div.story-container').length; i++) { + results.push(ProcessFeed(i, $, item.link)); + } - item.title = result.title; - item.description = result.content; - item.author = result.author; + item.title = results[0].title; + item.description = results.map((result) => result.content).join(''); + item.author = results[0].author; return item; }); })