Skip to content

Commit

Permalink
fix request
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5ea000000 committed Aug 5, 2021
1 parent 14c8f5a commit e54e4e9
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions LOLAutoBargain/AutoBargain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,37 +108,41 @@ public static async Task Run()
client.DefaultRequestHeaders.Add("token", landingToken);
client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) LeagueOfLegendsClient/11.15.388.2387 (CEF 74) Safari/537.36");
client.DefaultRequestHeaders.Add("referer", $"https://bargain.lol.garena.vn/?token={landingToken}");
client.DefaultRequestHeaders.Add("origin", $"https://bargain.lol.garena.vn");
client.DefaultRequestHeaders.Add("accept", $"application/json, text/plain, */*");


//Console.WriteLine("Getting profile ...");
//var configResponse = client.GetAsync("https://bargain.lol.garena.vn/api/config");
//var cfgmsg = await configResponse;
//Console.WriteLine(await cfgmsg.Content.ReadAsStringAsync());
//Console.WriteLine("---------------------------------------------------------");
Console.WriteLine("Getting profile ...");
var configResponse = client.GetAsync("https://bargain.lol.garena.vn/api/config");
var cfgmsg = await configResponse;
Console.WriteLine(await cfgmsg.Content.ReadAsStringAsync());
Console.WriteLine("---------------------------------------------------------");

//var profileResponse = client.GetAsync("https://bargain.lol.garena.vn/api/profile");
//var msg = await profileResponse;
//Console.WriteLine(await msg.Content.ReadAsStringAsync());
//Console.WriteLine("---------------------------------------------------------");
var profileResponse = client.GetAsync("https://bargain.lol.garena.vn/api/profile");
var msg = await profileResponse;
Console.WriteLine(await msg.Content.ReadAsStringAsync());
Console.WriteLine("---------------------------------------------------------");

//Uri uri = new Uri("https://bargain.lol.garena.vn");
//IEnumerable<Cookie> responseCookies = cookies.GetCookies(uri).Cast<Cookie>();
//foreach (Cookie cookie in responseCookies)
//{
// Console.WriteLine(cookie.Name + ": " + cookie.Value);
//}
Uri uri = new Uri("https://bargain.lol.garena.vn");
IEnumerable<Cookie> responseCookies = cookies.GetCookies(uri).Cast<Cookie>();
foreach (Cookie cookie in responseCookies)
{
Console.WriteLine(cookie.Name + ": " + cookie.Value);
}

Console.WriteLine("Spamming codes ...");

for (int i = 0; i < codes.Count; i++)
{
var jsonObject = new StringContent($"{{\"code\":\"{codes[i]}\",\"confirm\": true}}", Encoding.UTF8, "application/json");
Console.WriteLine(codes[i]);

var enterResponse = client.PostAsync("https://bargain.lol.garena.vn/api/enter", jsonObject);
var jsonObject = new StringContent($"{{\"code\":\"{codes[i]}\",\"confirm\": false}}", Encoding.UTF8, "application/json");
var tempEnterResponse = client.PostAsync("https://bargain.lol.garena.vn/api/enter", jsonObject);
var tempEntermsg = await tempEnterResponse;
var tempMsgstr = await tempEntermsg.Content.ReadAsStringAsync();

var jsonObject2 = new StringContent($"{{\"code\":\"{codes[i]}\",\"confirm\": true}}", Encoding.UTF8, "application/json");
Console.WriteLine(codes[i]);
var enterResponse = client.PostAsync("https://bargain.lol.garena.vn/api/enter", jsonObject2);
var entermsg = await enterResponse;

var msgstr = await entermsg.Content.ReadAsStringAsync();

Console.WriteLine(msgstr);
Expand Down

0 comments on commit e54e4e9

Please sign in to comment.