app: remove custom user-agent header

This commit is contained in:
DIYgod
2018-08-21 00:17:12 +08:00
parent 0dec07486e
commit 7d70671cc2
133 changed files with 18 additions and 418 deletions
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const name = ctx.params.name;
@@ -10,9 +9,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
},
});
const data = response.data;
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const name = ctx.params.name;
@@ -10,9 +9,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
},
});
const data = response.data;
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const sourceTimezoneOffset = -8;
module.exports = async (ctx) => {
@@ -8,9 +7,6 @@ module.exports = async (ctx) => {
const res = await axios({
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
},
});
const data = res.data;
const $ = cheerio.load(data);
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const currency = require('currency-symbol-map');
const config = require('../../config');
module.exports = async (ctx) => {
const country = ctx.params.country;
@@ -13,7 +12,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: `http://www.cheapcharts.info/itunes/${country}/apps/detail-view/${id}`,
},
});
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -10,9 +9,6 @@ module.exports = async (ctx) => {
const res = await axios({
method: 'get',
url,
headers: {
'User-Agent': config.ua,
},
});
const data = res.data;
const $ = cheerio.load(data);
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const locations = ctx.params.locations;
@@ -26,7 +25,6 @@ module.exports = async (ctx) => {
method: 'get',
url,
headers: {
'User-Agent': config.ua,
Referer: host,
},
});
-4
View File
@@ -1,5 +1,4 @@
const axios = require('../../../utils/axios');
const config = require('../../../config');
module.exports = async (ctx) => {
const bgmCalendarUrl = 'https://api.bgm.tv/calendar';
@@ -16,9 +15,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: url[i],
headers: {
'User-Agent': config.ua,
},
});
const data = response.data;
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const seasonid = ctx.params.seasonid;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://bangumi.bilibili.com/jsonp/seasoninfo/${seasonid}.ver?callback=seasonListCallback&jsonp=jsonp&_=${+new Date()}`,
headers: {
'User-Agent': config.ua,
Referer: `https://bangumi.bilibili.com/anime/${seasonid}/`,
},
});
-2
View File
@@ -1,12 +1,10 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://www.bilibili.com/activity/page/list?plat=1,2,3&mold=1&http=3&page=1&tid=0',
headers: {
'User-Agent': config.ua,
Referer: 'https://www.bilibili.com/blackboard/topic_list.html',
},
});
-8
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const qs = require('querystring');
const config = require('../../config');
const iconv = require('iconv-lite');
const cheerio = require('cheerio');
@@ -13,7 +12,6 @@ module.exports = {
method: 'post',
url: 'https://space.bilibili.com/ajax/member/GetInfo',
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
'Content-Type': 'application/x-www-form-urlencoded',
},
@@ -34,7 +32,6 @@ module.exports = {
method: 'get',
url: `https://api.live.bilibili.com/room/v1/Room/room_init?id=${shortID}`,
headers: {
'User-Agent': config.ua,
Referer: `https://live.bilibili.com/${shortID}`,
},
});
@@ -52,7 +49,6 @@ module.exports = {
method: 'get',
url: `https://api.live.bilibili.com/live_user/v1/UserInfo/get_anchor_in_room?roomid=${liveID}`,
headers: {
'User-Agent': config.ua,
Referer: `https://live.bilibili.com/${liveID}`,
},
});
@@ -69,9 +65,6 @@ module.exports = {
const nameResponse = await axios({
method: 'get',
url: `https://www.bilibili.com/video/av${aid}`,
headers: {
'User-Agent': config.ua,
},
responseType: 'arraybuffer',
});
const responseHtml = iconv.decode(nameResponse.data, 'UTF-8');
@@ -91,7 +84,6 @@ module.exports = {
method: 'get',
url: `https://api.bilibili.com/x/space/fav/nav?mid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/#/favlist`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -11,7 +10,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://space.bilibili.com/ajax/member/getCoinVideos?mid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const JSONbig = require('json-bigint');
const config = require('../../config');
module.exports = async (ctx) => {
const uid = ctx.params.uid;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
transformResponse: [(data) => data],
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/v2/fav/video?vmid=${uid}&fid=${fid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
-3
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -11,7 +10,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/relation/stat?vmid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
@@ -21,7 +19,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/relation/followers?vmid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
-3
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/relation/stat?vmid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
@@ -20,7 +18,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/relation/followings?vmid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const product = ctx.params.product;
@@ -22,7 +21,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.vc.bilibili.com/news/v1/notice/list?platform=pc&product=${product}&category=all&page_no=1&page_size=20`,
headers: {
'User-Agent': config.ua,
Referer: 'https://link.bilibili.com/p/eden/news',
},
});
-3
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const areaID = ctx.params.areaID;
@@ -19,7 +18,6 @@ module.exports = async (ctx) => {
method: 'get',
url: 'https://api.live.bilibili.com/room/v1/Area/getList',
headers: {
'User-Agent': config.ua,
Referer: 'https://link.bilibili.com/p/center/index',
},
});
@@ -56,7 +54,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.live.bilibili.com/room/v1/area/getRoomList?area_id=${areaID}&sort_type=${order}&page_size=30&page_no=1`,
headers: {
'User-Agent': config.ua,
Referer: 'https://live.bilibili.com/p/eden/area-tags',
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -15,7 +14,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.live.bilibili.com/room/v1/Room/get_info?room_id=${roomID}&from=room`,
headers: {
'User-Agent': config.ua,
Referer: `https://live.bilibili.com/${roomID}`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const key = ctx.params.key;
@@ -21,7 +20,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://search.bilibili.com/api/search?search_type=live_room&keyword=${urlEncodedKey}&order=${order}&coverType=user_cover&page=1`,
headers: {
'User-Agent': config.ua,
Referer: `https://search.bilibili.com/live?keyword=${urlEncodedKey}&order=${order}&coverType=user_cover&page=1&search_type=live`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://mall.bilibili.com/mall-c/search/category?keyword=&filters=&priceFlow=&priceCeil=&sortType=recommend&sortOrder=&pageIndex=1&state=&type=ip&id=${id}`,
headers: {
'User-Agent': config.ua,
Referer: `https://mall.bilibili.com/list.html?ip=${id}`,
},
});
-2
View File
@@ -1,12 +1,10 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://mall.bilibili.com/mall-c/home/calendar/list?page=new&startWeekNO=0&limitWeekSize=3',
headers: {
'User-Agent': config.ua,
Referer: 'https://mall.bilibili.com/date.html?page=new',
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const tid = ctx.params.tid;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/web-interface/newlist?ps=15&rid=${tid}&_=${+new Date()}`,
headers: {
'User-Agent': config.ua,
Referer: 'https://www.bilibili.com/',
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const rid = ctx.params.rid || '0';
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/web-interface/ranking?jsonp=jsonp&rid=${rid}&day=${day}&type=1&arc_type=0&callback=__jp0`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.bilibili.com/ranking/all/${rid}/0/${day}`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/v2/reply?type=1&oid=${aid}&sort=0`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.bilibili.com/video/av${aid}`,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const JSONbig = require('json-bigint');
const config = require('../../config');
module.exports = async (ctx) => {
const topic = ctx.params.topic;
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.vc.bilibili.com/topic_svr/v1/topic_svr/topic_new?topic_name=${urlEncodedTopic}`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.bilibili.com/tag/${urlEncodedTopic}/feed`,
},
transformResponse: [(data) => data],
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -13,7 +12,6 @@ module.exports = async (ctx) => {
method: 'get',
url: host,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://api.bilibili.com/x/v2/fav/video?vmid=${uid}&ps=30&tid=0&keyword=&pn=1&order=fav_time`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/#/favlist`,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cache = require('./cache');
module.exports = async (ctx) => {
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://space.bilibili.com/ajax/member/getSubmitVideos?mid=${uid}`,
headers: {
'User-Agent': config.ua,
Referer: `https://space.bilibili.com/${uid}/`,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const iconv = require('iconv-lite');
const baseUrl = 'https://www.biquge5200.com/';
@@ -12,7 +11,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `${baseUrl}${id}/`,
headers: {
'User-Agent': config.ua,
Host: 'www.biquge5200.com',
Referer: `${baseUrl}${id}/`,
},
+2 -8
View File
@@ -1,15 +1,9 @@
const cheerio = require('cheerio');
const config = require('../../config');
const axios = require('../../utils/axios');
const axios_ins = axios.create({
headers: {
'User-Agent': config.ua,
},
});
module.exports = async (ctx) => {
const url = `http://www.bjnews.com.cn/${ctx.params.cat}`;
const res = await axios_ins.get(url);
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const list = $('#news_ul li');
@@ -34,7 +28,7 @@ module.exports = async (ctx) => {
guid: itemUrl,
};
out.push(single);
proList.push(axios_ins.get(itemUrl));
proList.push(axios.get(itemUrl));
indexList.push(i);
}
const responses = await axios.all(proList);
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const platform = ctx.params.platform;
@@ -23,7 +22,6 @@ module.exports = async (ctx) => {
method: 'get',
url: APIUrl,
headers: {
'User-Agent': config.ua,
Referer: webUrl,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const category = ctx.params.category;
@@ -10,7 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const category = ctx.params.category;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-3
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const iconv = require('iconv-lite');
module.exports = async (ctx) => {
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: 'https://www.dapenti.com/blog/blog.asp?name=xilei&subjectid=70',
headers: {
'User-Agent': config.ua,
Referer: 'https://www.dapenti.com/blog/blog.asp?name=xilei&subjectid=70',
},
// 喷嚏网编码为GBK,需要转码
@@ -30,7 +28,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
responseType: 'arraybuffer',
-2
View File
@@ -8,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://disqus.com/api/3.0/forums/listPosts.json?api_key=${config.disqus.api_key}&forum=${forum}`,
headers: {
'User-Agent': config.ua,
Referer: 'https://disqus.com/',
},
});
@@ -28,7 +27,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://disqus.com/api/3.0/forums/listThreads.json?api_key=${config.disqus.api_key}&forum=${forum}${threadsQuery}`,
headers: {
'User-Agent': config.ua,
Referer: 'https://disqus.com/',
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
function replaceEmpty(str) {
return str.replace(' ', '');
@@ -15,7 +14,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
+2 -9
View File
@@ -1,15 +1,8 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
const _axios_client = axios.create({
headers: {
'User-Agent': config.ua,
},
});
module.exports = async (ctx) => {
const response = await _axios_client.get('http://www.dongqiudi.com/special/48');
const response = await axios.get('http://www.dongqiudi.com/special/48');
const $ = cheerio.load(response.data);
@@ -35,7 +28,7 @@ module.exports = async (ctx) => {
};
try {
const es = _axios_client.get(itemUrl);
const es = axios.get(itemUrl);
proList.push(es);
out.push(single);
} catch (err) {
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `http://open.douyucdn.cn/api/RoomApi/room/${id}`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.douyu.com/${id}`,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = {
getData: async (name, url) => {
@@ -8,7 +7,6 @@ module.exports = {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const company = ctx.params.company;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://www.kuaidi100.com/query?type=${company}&postid=${number}`,
headers: {
'User-Agent': config.ua,
Referer: 'https://www.kuaidi100.com',
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const { imdb_id } = ctx.params;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://eztv.ag/api/get-torrents?imdb_id=${imdb_id}`,
headers: {
'User-Agent': config.ua,
Referer: 'https://eztv.ag',
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -11,7 +10,6 @@ module.exports = async (ctx) => {
method: 'get',
url: APIUrl,
headers: {
'User-Agent': config.ua,
Referer: webUrl,
},
});
+1 -8
View File
@@ -1,12 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const axios_ins = axios.create({
headers: {
'User-Agent': config.ua,
},
});
module.exports = async (ctx) => {
if (ctx.params.platform === 'desktop') {
@@ -15,7 +8,7 @@ module.exports = async (ctx) => {
if (ctx.params.platform === 'android-beta') {
ctx.params.platform = 'android/beta';
}
const response = await axios_ins.get(`https://www.mozilla.org/en-US/firefox/${ctx.params.platform}/notes/`);
const response = await axios.get(`https://www.mozilla.org/en-US/firefox/${ctx.params.platform}/notes/`);
const data = response.data;
const $ = cheerio.load(data);
-7
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const sourceTimezoneOffset = -8;
module.exports = async (ctx) => {
@@ -9,9 +8,6 @@ module.exports = async (ctx) => {
const res = await axios({
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
},
});
const data = res.data;
let $ = cheerio.load(data);
@@ -42,9 +38,6 @@ module.exports = async (ctx) => {
itemRes = await axios({
method: 'get',
url: itemUrl,
headers: {
'User-Agent': config.ua,
},
});
} catch (e) {
return Promise.resolve();
-3
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const column_id = ctx.params.cid;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'https://time.geekbang.org/serv/v1/column/intro',
headers: {
'User-Agent': config.ua,
Referer: 'https://time.geekbang.org/',
'Content-Type': 'application/json',
},
@@ -25,7 +23,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'https://time.geekbang.org/serv/v1/column/articles/latest',
headers: {
'User-Agent': config.ua,
Referer: 'https://time.geekbang.org/',
'Content-Type': 'application/json',
},
-3
View File
@@ -12,9 +12,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url,
headers: {
'User-Agent': config.ua,
},
params: {
sort: 'created',
access_token: config.github.access_token,
-3
View File
@@ -7,9 +7,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: `https://api.github.com/users/${user}/repos`,
headers: {
'User-Agent': config.ua,
},
params: {
sort: 'created',
access_token: config.github.access_token,
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const since = ctx.params.since;
@@ -11,7 +10,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-4
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
@@ -20,9 +19,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url,
headers: {
'User-Agent': config.ua,
},
});
const $ = cheerio.load(response.data);
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const language = ctx.params.language === 'all' ? 'zh-CN' : ctx.params.language;
@@ -15,9 +14,6 @@ module.exports = async (ctx) => {
filter_locale: filter_locale,
sort: 'updated',
},
headers: {
'User-Agent': config.ua,
},
});
const data = res.data;
const $ = cheerio.load(data);
+2 -9
View File
@@ -1,16 +1,9 @@
const cheerio = require('cheerio');
const config = require('../../config');
const axios = require('../../utils/axios');
const axios_ins = axios.create({
headers: {
'User-Agent': config.ua,
},
});
module.exports = async (ctx) => {
const url = `http://${ctx.params.url}`;
const res = await axios_ins.get(`${url}/archives`);
const res = await axios.get(`${url}/archives`);
const data = res.data;
const $ = cheerio.load(data);
@@ -34,7 +27,7 @@ module.exports = async (ctx) => {
if (value) {
item.description = value;
} else {
const storyDeatil = await axios_ins.get(item.link);
const storyDeatil = await axios.get(item.link);
const data = storyDeatil.data;
const $ = cheerio.load(data);
item.pubDate = $('time').attr('datetime');
-4
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
@@ -14,9 +13,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url,
headers: {
'User-Agent': config.ua,
},
params: {
pid: 'website',
c: 'flexweb',
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const baseUrl = 'https://art.icity.ly';
@@ -16,7 +15,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const baseUrl = 'http://www.infzm.com/contents/';
@@ -11,7 +10,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://www.instagram.com/${id}/`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.instagram.com/${id}/`,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `http://www.iqiyi.com/${id}.html`,
headers: {
'User-Agent': config.ua,
Host: 'www.iqiyi.com',
Referer: `http://www.iqiyi.com/${id}.html`,
},
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const base64_decode = (i) => Buffer.from(i, 'base64').toString('binary');
@@ -15,7 +14,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `${baseUrl}${sub_model}/`,
headers: {
'User-Agent': config.ua,
Referer: 'http://jandan.net',
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://www.jianshu.com/c/${id}`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.jianshu.com/c/${id}`,
},
});
-2
View File
@@ -1,13 +1,11 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://www.jianshu.com',
headers: {
'User-Agent': config.ua,
Referer: 'https://www.jianshu.com',
},
});
-2
View File
@@ -1,13 +1,11 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://www.jianshu.com/trending/monthly',
headers: {
'User-Agent': config.ua,
Referer: 'https://www.jianshu.com/trending/monthly',
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://www.jianshu.com/u/${id}`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.jianshu.com/u/${id}`,
},
});
-2
View File
@@ -1,13 +1,11 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://www.jianshu.com/trending/weekly',
headers: {
'User-Agent': config.ua,
Referer: 'https://www.jianshu.com/trending/weekly',
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'https://app.jike.ruguoapp.com/1.0/messages/history',
headers: {
'User-Agent': config.ua,
Referer: `https://m.okjike.com/topics/${id}`,
'App-Version': '4.1.0',
},
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'https://app.jike.ruguoapp.com/1.0/squarePosts/list',
headers: {
'User-Agent': config.ua,
Referer: `https://m.okjike.com/topics/${id}`,
'App-Version': '4.1.0',
},
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'https://app.jike.ruguoapp.com/1.0/personalUpdate/single',
headers: {
'User-Agent': config.ua,
Referer: `https://web.okjike.com/user/${id}/post`,
'App-Version': '4.1.0',
platform: 'web',
-2
View File
@@ -1,5 +1,4 @@
const axios = require('axios');
const config = require('../../config');
module.exports = async (ctx) => {
const keyword = ctx.params.keyword;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://www.toutiao.com/search_content/?offset=0&format=json&keyword=${encodeURIComponent(keyword)}&autoload=true&count=20&cur_tab=1&from=search_tab`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.toutiao.com/search/?keyword=${encodeURIComponent(keyword)}`,
},
});
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const category = ctx.params.category;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: 'https://gold-tag-ms.juejin.im/v1/categories',
headers: {
'User-Agent': config.ua,
Referer: `https://juejin.im/welcome/${category}`,
'X-Juejin-Client': '',
'X-Juejin-Src': 'web',
@@ -25,7 +23,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://timeline-merger-ms.juejin.im/v1/get_entry_by_timeline?src=web&limit=20&category=${id}`,
headers: {
'User-Agent': config.ua,
Referer: `https://juejin.im/welcome/${category}`,
},
});
@@ -54,7 +51,6 @@ module.exports = async (ctx) => {
method: 'get',
url: item.originalUrl,
headers: {
'User-Agent': config.ua,
Referer: item.originalUrl,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('axios');
const cheerio = require('cheerio');
const config = require('../../config');
const keep_project_and_duration = (text) => {
const project = text
@@ -53,7 +52,6 @@ module.exports = async (ctx) => {
method: 'get',
url: requestUrl,
headers: {
'User-Agent': config.ua,
Host: 'show.gotokeep.com',
},
});
-4
View File
@@ -1,14 +1,10 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'http://www.xincheng.tv',
headers: {
'User-Agent': config.ua,
},
});
const data = response.data;
-4
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const { period = '1d' } = ctx.params;
@@ -10,9 +9,6 @@ module.exports = async (ctx) => {
method: 'get',
baseURL,
url: '/post/popular_recent.json',
headers: {
'User-Agent': config.ua,
},
params: {
period,
},
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const type = ctx.params.type;
@@ -13,9 +12,6 @@ module.exports = async (ctx) => {
sid: id,
tid: id,
},
headers: {
'User-Agent': config.ua,
},
});
const data = res.data;
const $ = cheerio.load(data);
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const baseApiUrl = 'http://pagelet.mafengwo.cn/note/pagelet/recommendNoteApi';
const baseUrl = 'http://www.mafengwo.cn';
@@ -27,7 +26,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-5
View File
@@ -1,14 +1,10 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const baseUrl = 'https://home.mi.com/app/shop/content?id=s8939d03918810635';
const response = await axios({
method: 'get',
url: baseUrl,
headers: {
'User-Agent': config.ua,
},
});
const data = response.data.match(/,gid:(\d*),src:"(.+?)"/g).map((item) => ({
@@ -28,7 +24,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://home.mi.com/app/shop/jsonp?k=test&m=Product&a=GetDetail&p={%22gid%22:${item.gid}}&_=${+new Date()}&callback=Zepto1532846359142`,
headers: {
'User-Agent': config.ua,
Referer: baseUrl,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const url = 'http://www.mihoyo.com/news/getNotice';
@@ -17,7 +16,6 @@ module.exports = async (ctx) => {
method: 'post',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
'x-requested-with': 'XMLHttpRequest',
},
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const url = 'https://www.bh3.com/index.php/news/_more';
@@ -19,7 +18,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
'x-requested-with': 'XMLHttpRequest',
},
-4
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cacheLength = 5;
const cacheDays = 30;
@@ -14,9 +13,6 @@ module.exports = async (ctx) => {
method: 'get',
baseURL: 'http://update.miui.com',
url: '/updates/miota-fullrom.php',
headers: {
'User-Agent': config.ua,
},
params: {
d: device,
b: releaseType,
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
let category = ctx.params.category;
@@ -13,7 +12,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -11,7 +10,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
let tag = ctx.params.tag;
@@ -12,7 +11,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const url = 'http://www.mzitu.com/zhuanti';
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: url,
},
});
+2 -9
View File
@@ -1,18 +1,11 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
const url = require('url');
const _axios_client = axios.create({
headers: {
'User-Agent': config.ua,
},
});
const host = 'http://www.namoc.org/xwzx/tzgg/2017gonggao/';
module.exports = async (ctx) => {
const response = await _axios_client.get(host);
const response = await axios.get(host);
const $ = cheerio.load(response.data);
@@ -36,7 +29,7 @@ module.exports = async (ctx) => {
};
try {
const es = _axios_client.get(itemUrl);
const es = axios.get(itemUrl);
proList.push(es);
out.push(single);
} catch (err) {
+2 -9
View File
@@ -1,18 +1,11 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
const url = require('url');
const _axios_client = axios.create({
headers: {
'User-Agent': config.ua,
},
});
const host = 'http://www.namoc.org/zsjs/zlzx/';
module.exports = async (ctx) => {
const response = await _axios_client.get(host);
const response = await axios.get(host);
const $ = cheerio.load(response.data);
@@ -36,7 +29,7 @@ module.exports = async (ctx) => {
};
try {
const es = _axios_client.get(itemUrl);
const es = axios.get(itemUrl);
proList.push(es);
out.push(single);
} catch (err) {
+2 -9
View File
@@ -1,18 +1,11 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
const url = require('url');
const _axios_client = axios.create({
headers: {
'User-Agent': config.ua,
},
});
const host = 'http://www.namoc.org/xwzx/mtry/2018/';
module.exports = async (ctx) => {
const response = await _axios_client.get(host);
const response = await axios.get(host);
const $ = cheerio.load(response.data);
@@ -36,7 +29,7 @@ module.exports = async (ctx) => {
};
try {
const es = _axios_client.get(itemUrl);
const es = axios.get(itemUrl);
proList.push(es);
out.push(single);
} catch (err) {
+2 -9
View File
@@ -1,18 +1,11 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
const url = require('url');
const _axios_client = axios.create({
headers: {
'User-Agent': config.ua,
},
});
const host = 'http://www.namoc.org/xwzx/xw/xinwen/';
module.exports = async (ctx) => {
const response = await _axios_client.get(host);
const response = await axios.get(host);
const $ = cheerio.load(response.data);
@@ -36,7 +29,7 @@ module.exports = async (ctx) => {
};
try {
const es = _axios_client.get(itemUrl);
const es = axios.get(itemUrl);
proList.push(es);
out.push(single);
} catch (err) {
+1 -8
View File
@@ -1,17 +1,10 @@
const axios = require('../../utils/axios');
const config = require('../../config');
const cheerio = require('cheerio');
const _axios_client = axios.create({
headers: {
'User-Agent': config.ua,
},
});
const host = 'http://www.namoc.org/xwzx/jdzt/2018zhuanti/';
module.exports = async (ctx) => {
const response = await _axios_client.get(host);
const response = await axios.get(host);
const $ = cheerio.load(response.data);
+2 -10
View File
@@ -1,18 +1,10 @@
const cheerio = require('cheerio');
const config = require('../../config');
const axios = require('../../utils/axios');
const axios_ins = axios.create({
headers: {
'User-Agent': config.ua,
Reference: 'https://www.natgeomedia.com',
},
});
module.exports = async (ctx) => {
const type = `${ctx.params.type ? ctx.params.type : ''}`;
const url = `https://www.natgeomedia.com/category/${ctx.params.cat}/${type}`;
const res = await axios_ins.get(url);
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
@@ -37,7 +29,7 @@ module.exports = async (ctx) => {
if (value) {
item.description = value;
} else {
const storyDetail = await axios_ins.get(item.link);
const storyDetail = await axios.get(item.link);
const data = storyDetail.data;
const $ = cheerio.load(data);
item.description = $('.td-post-content').html();
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `https://music.163.com/api/artist/albums/${id}`,
headers: {
'User-Agent': config.ua,
Referer: 'https://music.163.com/',
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const qs = require('querystring');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'http://music.163.com/api/dj/program/byradio',
headers: {
'User-Agent': config.ua,
Referer: 'https://music.163.com/',
'Content-Type': 'application/x-www-form-urlencoded',
},
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const qs = require('querystring');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'https://music.163.com/api/v3/playlist/detail',
headers: {
'User-Agent': config.ua,
Referer: 'https://music.163.com/',
'Content-Type': 'application/x-www-form-urlencoded',
},
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const qs = require('querystring');
const config = require('../../config');
module.exports = async (ctx) => {
const uid = ctx.params.uid;
@@ -9,7 +8,6 @@ module.exports = async (ctx) => {
method: 'post',
url: 'http://music.163.com/api/user/playlist',
headers: {
'User-Agent': config.ua,
Referer: 'https://music.163.com/',
'Content-Type': 'application/x-www-form-urlencoded',
},
-3
View File
@@ -1,13 +1,11 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'http://wufazhuce.com/',
headers: {
'User-Agent': config.ua,
Referer: 'http://wufazhuce.com/',
},
});
@@ -39,7 +37,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: 'http://wufazhuce.com/',
},
});
-3
View File
@@ -1,13 +1,11 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const res = await axios({
method: 'get',
url: 'https://www.oschina.net/news/',
headers: {
'User-Agent': config.ua,
Referer: 'https://www.oschina.net/news/',
},
});
@@ -39,7 +37,6 @@ module.exports = async (ctx) => {
method: 'get',
url: item.link,
headers: {
'User-Agent': config.ua,
Referer: item.link,
},
});
-2
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: `http://www.panda.tv/api_room?roomid=${id}`,
headers: {
'User-Agent': config.ua,
Referer: `https://www.panda.tv/${id}`,
},
});
-2
View File
@@ -1,4 +1,3 @@
const config = require('../../config');
const cheerio = require('cheerio');
const axios = require('../../utils/axios');
@@ -8,7 +7,6 @@ module.exports = async (ctx) => {
method: 'get',
url: base_url,
headers: {
'User-Agent': config.ua,
Referer: base_url,
},
});
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const host = 'http://eecs.pku.edu.cn/';
@@ -14,7 +13,6 @@ module.exports = async (ctx) => {
method: 'get',
url: host + 'Survey/Notice/?Mtitle=' + type,
headers: {
'User-Agent': config.ua,
Referer: host,
},
});
-4
View File
@@ -1,6 +1,5 @@
const axios = require('../../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../../config');
module.exports = async (ctx) => {
const url = 'https://cloud.tencent.com/document/product/454/7878';
@@ -8,9 +7,6 @@ module.exports = async (ctx) => {
const res = await axios({
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
},
});
const data = res.data;
const $ = cheerio.load(data);
-7
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -8,9 +7,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: `https://book.qidian.com/info/${id}#Catalog`,
headers: {
'User-Agent': config.ua,
},
});
const $ = cheerio.load(response.data);
@@ -22,9 +18,6 @@ module.exports = async (ctx) => {
const chapters_response = await axios({
method: 'get',
url: `https://book.qidian.com/ajax/book/category?${csrfToken}&bookId=${id}`,
headers: {
'User-Agent': config.ua,
},
});
const chapter_item = [];
-2
View File
@@ -1,6 +1,5 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
const parseDate = require('../../utils/date');
module.exports = async (ctx) => {
@@ -12,7 +11,6 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
headers: {
'User-Agent': config.ua,
Referer: `https://book.qidian.com/info/${id}`,
},
});
-4
View File
@@ -1,5 +1,4 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const category = ctx.params.category;
@@ -25,9 +24,6 @@ module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: `https://api.readhub.me/${category}`,
headers: {
'User-Agent': config.ua,
},
});
const data = response.data;
-2
View File
@@ -1,13 +1,11 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
const config = require('../../config');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://github.com/DIYgod/RSSHub/releases.atom',
headers: {
'User-Agent': config.ua,
Referer: 'https://github.com/DIYgod/RSSHub',
},
});

Some files were not shown because too many files have changed in this diff Show More