mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: 网易 encoding issue (#5983)
This commit is contained in:
@@ -115,12 +115,15 @@ module.exports = async (ctx) => {
|
||||
async (item) =>
|
||||
await ctx.cache.tryGet(item.link, async () => {
|
||||
try {
|
||||
const res = await got({
|
||||
method: 'get',
|
||||
url: item.link,
|
||||
responseType: 'buffer',
|
||||
});
|
||||
const content = cheerio.load(iconv.decode(res.data, 'gbk'));
|
||||
let res;
|
||||
let content;
|
||||
if (item.link.startsWith('https://ent.163.com')) {
|
||||
res = await got({ method: 'get', url: item.link, responseType: 'buffer' });
|
||||
content = cheerio.load(iconv.decode(res.data, 'gbk'));
|
||||
} else {
|
||||
res = await got.get(item.link);
|
||||
content = cheerio.load(res.data);
|
||||
}
|
||||
|
||||
if (content('#ne_wrap').attr('data-publishtime')) {
|
||||
// To get pubDate from most pages.
|
||||
|
||||
Reference in New Issue
Block a user