Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http.MimeType:='application/x-www-form-urlencoded';
- http.UserAgent:='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36';
- if http.HTTPMethod(GET, 'https://www.epicgames.com/login?redirected=1') then
- begin
- HTML.LoadFromStream(HTTP.Document);
- Parsing[0]:=Form1.Pars('client_id=', HTTP.Headers.Text, '&');
- http.Clear;
- http.MimeType:='application/x-www-form-urlencoded';
- if http.HTTPMethod(GET, 'https://accounts.epicgames.com/login/doLogin?client_id='+Parsing[0]+'&redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fru') then
- begin
- HTML.LoadFromStream(HTTP.Document);
- Parsing[1]:=Form1.Pars('<input type="hidden" name="X-XSRF-TOKEN" value="', Html.Text, '"');
- http.Clear;
- http.MimeType:='application/x-www-form-urlencoded';
- DATA.WriteString('X-XSRF-TOKEN='+Parsing[1]+'&X-XSRF-URI=%2Flogin%2FdoLogin&fromForm=yes&authType=&linkExtAuth=&client_id=+Parsing[0]+&redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fru&epic_username='+Input.Login+'&password='+Input.Password);
- HTTP.Document.LoadFromStream(DATA);
- http.Headers.Add('Referer:https://accounts.epicgames.com/login?lang=ru&redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fru&client_id='+Parsing[0]+'&noHostRedirect=true');
- if http.HttpMethod(POST, 'https://accounts.epicgames.com/login/doLogin') then
- begin
- if Pos('Set-Cookie: EPIC_BEARER_TOKEN=', HTTP.Headers.Text) <> 0 then
- begin
- HTTP.Document.Clear;
- HTTP.Headers.Clear;
- HTTP.HTTPMethod('GET', '');
- HTML.LoadFromStream(HTTP.Document);
- HTML.Text:=Utf8ToAnsi(HTML.Text);
- Parsing[2]:=Form1.Pars('', html.text ,'');
- Result:=Good
- end else Result:=Bad;
- end else Result:=Error;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement