111
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user