fix Lucky"v1.0.1

支持Lucky最新版本获取ipv4
This commit is contained in:
thsrite
2025-01-20 15:23:55 +08:00
parent 569e3f21b1
commit ecaf187238
2 changed files with 5 additions and 4 deletions

View File

@@ -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。"
}
}
}

View File

@@ -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