fix SiteStatistic

This commit is contained in:
jxxghp
2024-03-26 15:44:04 +08:00
parent 68563af666
commit 63f10e5367
3 changed files with 3 additions and 3 deletions

View File

@@ -18,7 +18,7 @@
"SiteStatistic": {
"name": "站点数据统计",
"description": "自动统计和展示站点数据。",
"version": "2.4",
"version": "2.5",
"icon": "statistic.png",
"author": "lightolly",
"level": 2

View File

@@ -43,7 +43,7 @@ class SiteStatistic(_PluginBase):
# 插件图标
plugin_icon = "statistic.png"
# 插件版本
plugin_version = "2.4"
plugin_version = "2.5"
# 插件作者
plugin_author = "lightolly"
# 作者主页

View File

@@ -322,7 +322,7 @@ class ISiteUserInfo(metaclass=ABCMeta):
proxies=proxies,
headers=req_headers).get_res(url=url)
if res is not None and res.status_code in (200, 500, 403):
if req_headers and "application/json" in req_headers.get("Accept"):
if req_headers and "application/json" in str(req_headers.get("Accept")):
return json.dumps(res.json())
else:
# 如果cloudflare 有防护,尝试使用浏览器仿真