From ecaf1872383b0755bfb9a0fb031c829f39672c52 Mon Sep 17 00:00:00 2001 From: thsrite Date: Mon, 20 Jan 2025 15:23:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=20Lucky"v1.0.1=20=E6=94=AF=E6=8C=81Lucky?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC=E8=8E=B7=E5=8F=96ipv4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +++-- plugins/lucky/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5b53555..389a2c8 100644 --- a/package.json +++ b/package.json @@ -776,13 +776,14 @@ "name": "Lucky", "description": "Lucky HomePage自定义API。", "labels": "工具", - "version": "1.0", + "version": "1.0.1", "icon": "Lucky_A.png", "author": "thsrite", "level": 1, "v2": true, "history": { - "v1.0": "Lucky HomePage自定义API。" + "v1.0.1": "支持Lucky最新版本获取ipv4。", + "v1.0.0": "Lucky HomePage自定义API。" } } } diff --git a/plugins/lucky/__init__.py b/plugins/lucky/__init__.py index 43435cd..a83e566 100644 --- a/plugins/lucky/__init__.py +++ b/plugins/lucky/__init__.py @@ -18,7 +18,7 @@ class Lucky(_PluginBase): # 插件图标 plugin_icon = "Lucky_A.png" # 插件版本 - plugin_version = "1.0" + plugin_version = "1.0.1" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -75,7 +75,7 @@ class Lucky(_PluginBase): response = requests.get(ip_url, verify=False) # 关闭SSL证书验证 response.raise_for_status() # 如果状态码不是 2xx,抛出异常 if response.json().get('ret') == 0: - return response.json().get('data')[0].get('IpAddr') + return response.json().get('data')[0].get('IpAddr') or response.json().get('data')[0].get('Ipv4Addr') except requests.exceptions.RequestException as e: logging.error("An error occurred:", e) return None