panda9510

Spotify

Jan 23rd, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.06 KB | None | 0 0
  1.  
  2. Dim request1 As New HttpRequest()
  3.  
  4. request1.Cookies = New CookieDictionary()
  5.  
  6. request1.UserAgent = Http.FirefoxUserAgent
  7.  
  8. request1.Get("https://accounts.spotify.com/en-US/login?continue=https:%2F%2Fwww.spotify.com%2Fus%2Faccount%2Foverview%2F")
  9.  
  10. Dim token As String = request1.Cookies.ToString
  11.  
  12. Dim csrf As String = Regex.Match(token, "csrf_token=(\S+)").Groups(1).ToString
  13.  
  14.  
  15. Try
  16.  
  17. request1.Cookies = request1.Cookies
  18. request1.UserAgent = request1.UserAgent
  19. request1.Referer = "https://accounts.spotify.com/en-US/login?continue=https:%2F%2Fwww.spotify.com%2Fus%2Faccount%2Foverview%2F"
  20. request1.AddHeader("Cookie", "csrf_token=" + csrf + "; __bon=MHwwfDQ1MzY4Nzk4M3wxOTA1NDg5NTI4NnwxfDF8MXwx; fb_continue=https%3A%2F%2Fwww.spotify.com%2Fus%2Faccount%2Foverview%2F; remember=" + TextBox1.Text)
  21. request1.AddParam("remember", "true")
  22. request1.AddParam("username", "vincent.vega301195@gmail.com")
  23. request1.AddParam("password", "Vincent3011")
  24. request1.AddParam("captcha_token", "")
  25. request1.AddParam("csrf_token", csrf)
  26. Dim response1 As String = request1.Post("https://accounts.spotify.com/api/login").ToString
  27.  
  28. Dim hhhhh As String = request1.Get("https://www.spotify.com/us/account/overview/").ToString()
  29.  
  30. Dim match As System.Text.RegularExpressions.Match = (New Regex("""plan"":{""title"":""Your plan"",""plan"":{""name"":""([^""]*)")).Match(hhhhh)
  31. Dim match1 As System.Text.RegularExpressions.Match = (New Regex("{""label"":""Country"",""value"":""([^""]*)")).Match(hhhhh)
  32.  
  33. RichTextBox1.Text = response1
  34.  
  35. RichTextBox1.Text = match.Groups(1).Value + ": Country is : " + match1.Groups(1).Value
  36.  
  37.  
  38. If response1.Contains("displayName") Then
  39. MsgBox("Succesfully logged In!")
  40.  
  41.  
  42.  
  43.  
  44. End If
  45.  
  46. Catch ex As Exception
  47. Dim res As HttpResponse = request1.Response
  48.  
  49. Dim geterror As String = res.ToString
  50.  
  51. RichTextBox1.Text += geterror
  52.  
  53. If geterror.Contains("errorInvalidCredentials") Then
  54. MsgBox("Invalid Credentials")
  55. End If
  56.  
  57. End Try
Add Comment
Please, Sign In to add comment