From 0c0bbd40099eceec7e344593dc5ef1b27c64bd59 Mon Sep 17 00:00:00 2001 From: prnake Date: Sat, 10 Oct 2020 03:57:27 +0800 Subject: [PATCH] fix: btbyr (#5833) --- lib/config.js | 2 +- lib/routes/universities/bupt/funbox.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/config.js b/lib/config.js index f5caf3b5d9..5b875cc0cc 100644 --- a/lib/config.js +++ b/lib/config.js @@ -144,7 +144,7 @@ const calculateValue = () => { bearertoken: envs.INITIUM_BEARER_TOKEN, }, btbyr: { - host: envs.BTBYR_HOST || 'https://bt.byr.cn/', + host: envs.BTBYR_HOST, cookies: envs.BTBYR_COOKIE, }, mastodon: { diff --git a/lib/routes/universities/bupt/funbox.js b/lib/routes/universities/bupt/funbox.js index 9057c2b49c..f0facf769d 100644 --- a/lib/routes/universities/bupt/funbox.js +++ b/lib/routes/universities/bupt/funbox.js @@ -4,7 +4,7 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const cookie = config.btbyr.cookies; - const url = config.btbyr.host; + const url = config.btbyr.host || 'https://bt.byr.cn/'; const response = await got({ method: 'get', url: url + `log.php?action=funbox`, @@ -24,6 +24,7 @@ module.exports = async (ctx) => { .find('tr > td.rowfollow') .eq(2) .html() + .replace(/https:\/\/bt.byr.cn\//g, url) .replace(/onclick=.*findPosition\(this\)\[1\]-58\);"/g, '') .replace(/.thumb.jpg/g, ''), link: url + `log.php?action=funbox`,