mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: full text error in discuz (#3880)
This commit is contained in:
@@ -25,11 +25,14 @@ async function load(baseUrl, itemLink, ctx, charset) {
|
||||
// 处理编码问题
|
||||
let responseData;
|
||||
if (charset === 'utf-8') {
|
||||
responseData = await got.get(itemLink).data;
|
||||
responseData = (await got.get(itemLink)).data;
|
||||
} else {
|
||||
responseData = iconv.decode((await got.get({ url: itemLink, responseType: 'buffer' })).data, charset);
|
||||
}
|
||||
|
||||
if (!responseData) {
|
||||
const description = '获取详细内容失败';
|
||||
return { description };
|
||||
}
|
||||
const $ = cheerio.load(responseData);
|
||||
// 只抓取论坛1楼消息
|
||||
const description = $('div#postlist div[id^=post] td[id^=postmessage]')
|
||||
|
||||
Reference in New Issue
Block a user