Skip to content

Commit

Permalink
fix check ban reason
Browse files Browse the repository at this point in the history
  • Loading branch information
KebsCS committed Aug 20, 2023
1 parent 00d5c1f commit 42146a7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion KBotExt/LoginTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,24 @@ class LoginTab
cpr::Header authHeader = {
{"Content-Type", "application/json"},
{"Accept-Encoding", "deflate"},
{"User-Agent", "RiotClient/64.0.4.4947777.4789131 rso-auth (Windows;10;;Home, x64)"},
{"User-Agent", "RiotClient/69.0.3.228.1352 rso-auth (Windows;10;;Home, x64)"},
{"Pragma", "no-cache"},
{"Accept-Language", "en-GB,en,*"},
{"Accept", "application/json, text/plain, */*"}
};

cpr::Session session;
session.SetHeader(authHeader);

std::string valoApi = cpr::Get(cpr::Url{ "https://valorant-api.com/v1/version" }).text;

std::regex regexStr("\"riotClientBuild\":\"(.*?)\"");
std::smatch m;
if (std::regex_search(valoApi, m, regexStr))
{
session.UpdateHeader(cpr::Header{ { "User-Agent", m[1].str()} });
}

session.SetBody(authData.toStyledString());
session.SetUrl("https://auth.riotgames.com/api/v1/authorization");
session.Post();
Expand Down

0 comments on commit 42146a7

Please sign in to comment.