mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
arraybuffer to buffer
This commit is contained in:
@@ -8,7 +8,7 @@ async function load(link, ctx) {
|
|||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
const response = await axios.get(link, {
|
const response = await axios.get(link, {
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
response.data = iconv.decode(response.data, 'gb2312');
|
response.data = iconv.decode(response.data, 'gb2312');
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module.exports = async (ctx) => {
|
|||||||
|
|
||||||
const link = `http://opinion.people.com.cn/GB/${id}/index.html`;
|
const link = `http://opinion.people.com.cn/GB/${id}/index.html`;
|
||||||
const response = await axios.get(link, {
|
const response = await axios.get(link, {
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
response.data = iconv.decode(response.data, 'gbk');
|
response.data = iconv.decode(response.data, 'gbk');
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ module.exports = async (ctx) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const response = await axios.get(itemUrl, {
|
const response = await axios.get(itemUrl, {
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
response.data = iconv.decode(response.data, 'gbk');
|
response.data = iconv.decode(response.data, 'gbk');
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module.exports = async (ctx) => {
|
|||||||
headers: {
|
headers: {
|
||||||
Referer: pcUrl,
|
Referer: pcUrl,
|
||||||
},
|
},
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(iconv.decode(storyDetail.data, 'gb2312'));
|
const $ = cheerio.load(iconv.decode(storyDetail.data, 'gb2312'));
|
||||||
$('#articleContent img').each(function(_, item) {
|
$('#articleContent img').each(function(_, item) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module.exports = async (ctx) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const response = await axios.get(itemUrl, {
|
const response = await axios.get(itemUrl, {
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
|
|
||||||
response.data = iconv.decode(response.data, 'gbk');
|
response.data = iconv.decode(response.data, 'gbk');
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = async (ctx) => {
|
|||||||
const response = await axios({
|
const response = await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: host,
|
url: host,
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
|
|
||||||
const responseHtml = iconv.decode(response.data, 'gbk');
|
const responseHtml = iconv.decode(response.data, 'gbk');
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
|
|||||||
const res = await axios({
|
const res = await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: 'http://jww.zjgsu.edu.cn/ArticleList.asp?nid=83',
|
url: 'http://jww.zjgsu.edu.cn/ArticleList.asp?nid=83',
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
res.data = iconv.decode(res.data, 'gb2312');
|
res.data = iconv.decode(res.data, 'gb2312');
|
||||||
const $ = cheerio.load(res.data);
|
const $ = cheerio.load(res.data);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
|
|||||||
const res = await axios({
|
const res = await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: 'http://jww.zjgsu.edu.cn/ArticleList.asp?nid=6',
|
url: 'http://jww.zjgsu.edu.cn/ArticleList.asp?nid=6',
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
res.data = iconv.decode(res.data, 'gb2312');
|
res.data = iconv.decode(res.data, 'gb2312');
|
||||||
const $ = cheerio.load(res.data);
|
const $ = cheerio.load(res.data);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ module.exports = async (ctx) => {
|
|||||||
const res = await axios({
|
const res = await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: host + `${id}`,
|
url: host + `${id}`,
|
||||||
responseType: 'arraybuffer',
|
responseType: 'buffer',
|
||||||
});
|
});
|
||||||
|
|
||||||
const $ = cheerio.load(iconv.decode(res.data, 'gb2312'));
|
const $ = cheerio.load(iconv.decode(res.data, 'gb2312'));
|
||||||
|
|||||||
Reference in New Issue
Block a user