mirror of
https://github.com/thsrite/MoviePilot-Plugins.git
synced 2026-03-27 10:05:57 +00:00
fix Lucky"v1.0.1
支持Lucky最新版本获取ipv4
This commit is contained in:
@@ -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。"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user