This commit is contained in:
2022-05-08 07:29:20 +08:00
parent 201cec9c34
commit a0f64376e9
3 changed files with 10 additions and 15 deletions

View File

@@ -351,24 +351,16 @@ void DNFTOOL::GMNotice(char* str, int type, int color)
#else
std::string DNFTOOL::GetIP()
{
std::cout << "111" << std::endl;
httplib::SSLClient Tencword("docs.qq.com");
std::cout << "444" << std::endl;
httplib::SSLClient Tencword("gitee.com");
std::string body;
auto res = Tencword.Get("/doc/DQ1dGbVpzTkZDVlhY",
auto res = Tencword.Get("/yosin_team/request-ip/raw/master/README.md",
[&](const char* data, size_t data_length) {
body.append(data, data_length);
return true;
});
std::cout << "333" << std::endl;
int strat_index = body.find("Yosin_Ip:");
int end_index = body.find("Yosin_IP");
std::cout << "222" << std::endl;
if (strat_index != -1 && end_index != -1)
if (!body.empty())
{
std::string rqip = body.substr(strat_index + 9, end_index - (strat_index + 9));
std::cout << "333" << std::endl;
return rqip;
return body;
}
else
return GetIP();