From f536851d5753960dd3ef0eb2e2cef2b40e416505 Mon Sep 17 00:00:00 2001 From: maijver Date: Sun, 19 Apr 2020 19:01:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D36=E6=B0=AA=E5=BF=AB?= =?UTF-8?q?=E8=AE=AF,=20b=E7=AB=99UP=E4=B8=BB=E5=8A=A8=E6=80=81,=20segment?= =?UTF-8?q?fault=E9=A2=91=E9=81=93,=20=E7=95=8C=E9=9D=A2=E6=96=B0=E9=97=BB?= =?UTF-8?q?=20(#4480)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/36kr/newsflashes.js | 24 ++++++-------- lib/routes/bilibili/dynamic.js | 12 +++++-- lib/routes/jiemian/list.js | 52 +++++++----------------------- lib/routes/segmentfault/channel.js | 2 +- 4 files changed, 31 insertions(+), 59 deletions(-) diff --git a/lib/routes/36kr/newsflashes.js b/lib/routes/36kr/newsflashes.js index a8cddcd671..ddbb8a2f2e 100644 --- a/lib/routes/36kr/newsflashes.js +++ b/lib/routes/36kr/newsflashes.js @@ -3,24 +3,20 @@ const got = require('@/utils/got'); module.exports = async (ctx) => { const response = await got({ method: 'get', - url: `https://36kr.com/api/newsflash?per_page=30`, + url: `https://36kr.com/newsflashes`, headers: { - 'Content-Type': 'application/json; charset=utf-8', + Host: '36kr.com', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25', }, }); + const regexp = /