From 1188f9a86329d77d5ab1a02826421539a0ce2f73 Mon Sep 17 00:00:00 2001 From: chickliu Date: Thu, 21 Nov 2024 19:59:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E5=82=BB=E7=8B=97?= =?UTF-8?q?=E9=98=85=E8=AF=BB=5Fapi.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 傻狗阅读_api.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/傻狗阅读_api.py b/傻狗阅读_api.py index ec0b022..0cbca17 100644 --- a/傻狗阅读_api.py +++ b/傻狗阅读_api.py @@ -52,7 +52,7 @@ from notify import send logging.basicConfig(level=logging.INFO, format='[%(levelname)s] ===> %(message)s') code = "傻狗阅读_api版" -ver = "1.2" +ver = "1.3" envname = "yuanshen_api" debug = False #debug模式 开启即从脚本内部获取环境变量 @@ -390,15 +390,16 @@ class yuanshen: if r['success']: logging.info('参数被加密 进行解密操作') code = r["decodedCode"] - regex = r"a\((['\"])(.*?)\1,\s*(['\"])(.*?)\3,\s*(['\"])(.*?)\5\)" - matches = re.findall(regex, code) - if matches: - for match in matches: - param1, param2, param3 = match[1], match[3], match[5] - print("参数1:", param1) - print("参数2:", param2) - print("参数3:", param3) - self.read_session = param2 + t = re.findall(r'"(.*?)"', code) + + if t: + p1, p2, p3,p4 = t[0], t[1], t[2], t[3] + print("参数1:", p1) + print("参数2:", p2) + print("参数3:", p3) + print("参数4:", p4) + self.read_session = p2 + self.magicnumber = p4 else: print("没有匹配到调用") @@ -451,7 +452,7 @@ class yuanshen: "sign": sign, "time": timestamp } - url = f'https://api.yd.dgtech.top/ydrw/article?_t={timestamp}' + url = f'https://api.yd.dgtech.top/ydrw/{self.magicnumber}?_t={timestamp}' r = requests.post(url,json=data,headers=self.readh).json() if r['success']: self.readurl = r['data']['url']