From 4e988ddcf00c5a2f2b97610609e89e2ac35f9653 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Wed, 21 Sep 2022 19:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88js=E5=8A=A0=E8=BD=BD=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/parser.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/parser.py b/utils/parser.py index 424614a..f824fa9 100644 --- a/utils/parser.py +++ b/utils/parser.py @@ -39,10 +39,9 @@ def runJs(jsPath, before='', after='', ctx=None): if str(jsPath).startswith('http'): js_name = jsPath.split('/')[-1] cache_path = os.path.join(base_path, f'cache/{js_name}') - print('远程规则:',js_name) if not os.path.exists(cache_path): try: - print(jsPath) + print(f'开始缓存远程规则:{js_name},来源{jsPath}') js_code = requests.get(url=jsPath,timeout=3).text # js_code = requests.get(jsPath).text with open(cache_path,mode='w+',encoding='utf-8') as f: @@ -61,7 +60,7 @@ def runJs(jsPath, before='', after='', ctx=None): cache_path = os.path.join(base_path, f'cache/{js_name}') if not str(jsPath).startswith('js/') and not os.path.exists(cache_path) and os.path.exists(js_path): shutil.copy(js_path,cache_path) # 本地txt目录的复制过去凑数,实际不使用 - print(js_path) + # print(js_path) with open(js_path, 'r', encoding='UTF-8') as fp: js_code = fp.read() # print(js_code) -- GitLab