fix: full text error in discuz (#3880)
This commit is contained in:
parent
a733f1a7c3
commit
40aa69ff0e
|
|
@ -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]')
|
||||
|
|
|
|||
Loading…
Reference in New Issue