From c0d02cbb4e4b5912fd424541f5ddb82bfc7a83f6 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Mon, 3 Oct 2022 20:26:49 +0800 Subject: [PATCH] =?UTF-8?q?pD=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/rules.db | Bin 86016 -> 86016 bytes libs/drpy.js | 10 +++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/base/rules.db b/base/rules.db index 39dcb9aa211fb13ea9ff353cfcbb1e5992ea15c6..d2dc06ad7914f27ff1c2036d6f30edd22e8cae90 100644 GIT binary patch delta 22 ecmZozz}m2Yb%HeG>xnYXjISFLwk9wx@CN{5q6nk_ delta 22 ecmZozz}m2Yb%HeG%ZW11j4vA#wk9wx@CN{5cnF{X diff --git a/libs/drpy.js b/libs/drpy.js index 6ef2c83..cbb74da 100644 --- a/libs/drpy.js +++ b/libs/drpy.js @@ -5,6 +5,7 @@ import cheerio from 'https://gitcode.net/qq_32394351/dr_py/-/raw/master/libs/che import 'https://gitcode.net/qq_32394351/dr_py/-/raw/master/libs/drT.js'; // import 'http://192.168.10.103:5705/libs/drT.js'; import muban from 'https://gitcode.net/qq_32394351/dr_py/-/raw/master/js/模板.js'; +import pa from "./cheerio.min"; // import muban from 'http://192.168.10.103:5705/admin/view/模板.js'; // const key = 'drpy_zbk'; @@ -211,9 +212,16 @@ function pD(html,parse,uri){ if(typeof(uri)==='undefined'||!uri){ uri = ''; } + if(/(url|src|href|data-original|data-src)$/.test(parse)){ + if(/http/.test(ret)){ + ret = ret.substr(ret.indexOf('http')); + }else{ + ret = urljoin(MY_URL,ret) + } + } // MY_URL = getItem('MY_URL',MY_URL); // console.log(`规则${RKEY}打印MY_URL:${MY_URL},uri:${uri}`); - return urljoin(MY_URL,ret) + return ret } /*** js自封装的方法 ***/ -- GitLab