Guest User

Untitled

a guest
Nov 22nd, 2018
863
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. RestClient Client = new RestClient(Settings.Url)
  2. {
  3. UserAgent = Settings.UserAgent,
  4. FollowRedirects = false
  5. };
  6.  
  7. RestRequest Req = new RestRequest(Method.POST);
  8. Req.AddHeader("Content-Type", Settings.ContentType);
  9. Req.AddHeader("Accept", "application/json, text/plain, */*");
  10. Req.AddHeader("Accept-Encoding", "gzip, deflate, br");
  11. Req.AddHeader("Accept-Language", "en-US,en;q=0.9");
  12.  
  13. Req.AddHeader("Referer", Settings.Referer);
  14.  
  15. Req.AddParameter("remember=false&username=xxx&password=xxx&captcha_token=&csrf_token=", ParameterType.RequestBody);
  16. Client.ExecuteAsync(Req, response =>
  17. {
  18. if (response.StatusCode == HttpStatusCode.BadRequest)
  19. {
  20. Console.WriteLine("Access DENIED!", Color.DarkRed);
  21. }
  22. else
  23. {
  24. Console.WriteLine("Accessed.", Color.Green);
  25. }
  26. });
  27.  
  28. public class Settings
  29. {
  30. public static string Url = "https://accounts.spotify.com/api/login";
  31. public static string Referer = "https://accounts.spotify.com/en/login/";
  32. public static string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36";
  33. public static string ContentType = "application/x-www-form-urlencoded";
  34. }
Add Comment
Please, Sign In to add comment