Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

由于公网IP获取api隐藏最后一段IP导致程序出错 #34

Closed
wanduwang opened this issue Oct 23, 2023 · 2 comments
Closed

由于公网IP获取api隐藏最后一段IP导致程序出错 #34

wanduwang opened this issue Oct 23, 2023 · 2 comments

Comments

@wanduwang
Copy link

wanduwang commented Oct 23, 2023

第一次提issue,如有不对之处请直接指出
源码中关于获取api有六个可选网址,但是默认在第一位的api
https://api-v3.speedtest.cn/ip
返回值隐藏了四段IP的最后一段(这里是我魔法上网的测试结果,实际上我是香港)
{
"code": 0,
"data": {
"country": "俄罗斯",
"province": null,
"city": "莫斯科",
"district": "",
"isp": null,
"lon": "0.0",
"lat": "0.0",
"countryCode": "RU",
"ip": "46.232.121.*",
"operator": null
},
"msg": "ok"
}
IP字段最后是星号,而源码中并没有校验返回IP的合法性导致程序无限使用这个API而namesilo由于IP地址有问题并无法更新当前IP导致程序死锁
希望尽快修复
后面是正常apihttps://forge.speedtest.cn/api/location/info返回的结果
{
"ip": "46.232.121.32",
"full_ip": "46.232.121.32",
"country": "俄罗斯",
"country_code": "RU",
"province": null,
"city": "莫斯科",
"distinct": null,
"isp": null,
"operator": null,
"lon": "37.7239",
"lat": "55.6621",
"net_str": "俄罗斯"
}

@wanduwang
Copy link
Author

wanduwang commented Oct 23, 2023

源码位置在current_ip.py的37行,我使用的dockers版本所以无法修改源码,请问为什么单纯下载release不能直接运行py文件?
我看到readme.md文件中写了直接使用在Windows环境下可以直接双击vbs或bat文件,而release版本中并没有可运行的批处理文件,希望能一并修复(win下docker真的难用)

@Charles94jp
Copy link
Owner

已经修复了,pull最新代码即可。
还没有release新版本,但是dockerhub最新镜像是可用的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants