From 6bbe3b718e308d410ba38cdca6eacae06ae90bfc Mon Sep 17 00:00:00 2001 From: Aomd Date: Mon, 24 Apr 2023 14:08:55 +0800 Subject: [PATCH] =?UTF-8?q?IT=E4=B9=8B=E5=AE=B6=20=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E4=B8=8B=E6=A0=87=E8=B6=85=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IT之家 匹配下标超出异常 --- routes/ithome.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/ithome.js b/routes/ithome.js index 05db858..1da2e5c 100644 --- a/routes/ithome.js +++ b/routes/ithome.js @@ -19,7 +19,7 @@ const headers = { // it之家特殊处理 - url const replaceLink = (url) => { - const match = url.match(/html\/(\d+)\.htm/)[1]; + const match = url.match(/[html|live]\/(\d+)\.htm/)[1]; return `https://www.ithome.com/0/${match.slice(0, 3)}/${match.slice(3)}.htm`; };