zymtom

Spotify Account Creator

Oct 3rd, 2014
11,982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.32 KB | None | 0 0
  1. import requests
  2. import re
  3. import string
  4. import random
  5. import HTMLParser
  6. import json
  7. def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
  8.     return ''.join(random.choice(chars) for _ in range(size))
  9. username = ""
  10. while(1):
  11.     username = raw_input("What do you want your username to be? ")
  12.     r = requests.get("https://www.spotify.com/us/xhr/json/isUsernameAvailable.php?username=" + username, verify=False)
  13.     if r.content == "true":
  14.         print("The username is available")
  15.         break
  16.     else:
  17.         print("It's not available")
  18. """email = ""
  19. while(1):
  20.     email = raw_input("What do you want your username to be? ")
  21.     r = requests.get("https://www.spotify.com/us/xhr/json/isEmailAvailable.php?email=" + email)
  22.     if r.content == "true":
  23.         print("The email is available")
  24.         break
  25.     else:
  26.         print("It's not available")"""
  27. password = raw_input("What do you wish your password to be? ")
  28. realemail = username + id_generator()
  29. url = "http://www.yopmail.com/en/?" + realemail
  30. r = requests.get(url, verify=False)
  31. regex = re.search(r'<span class="nw b" id="autoaltcpt"><em>(.*?)</em>(.*?)</span>', r.content)
  32. email1 = regex.group(1)
  33. email2 = regex.group(2)
  34. h = HTMLParser.HTMLParser()
  35. cookies = {
  36.  
  37. }
  38. url = "https://www.spotify.com/us/signup/?forward_url=%2Fus%2Faccount%2Foverview%2F"
  39. sess = requests.session()
  40. sess.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
  41. resp = sess.get(url, verify=False)
  42. url = resp.url
  43. page = resp.content
  44. auth1 = resp.cookies['sp_csrf']
  45. for keys in resp.cookies.keys():
  46.     cookies[keys] = resp.cookies[keys]
  47. #auth1 = re.search(r'class="js-sp-csrf" name="sp_csrf" type="hidden" value="(.*?)">', page).group(1)
  48. auth2 = re.search(r'name="form_token" type="hidden" value="(\w+)">', page).group(1)
  49. postparam = {
  50. 'sp_csrf':auth1,
  51. 'form_token':auth2,
  52. 'creation_flow':'',
  53. 'forward_url':'/us/account/overview/',
  54. 'signup_pre_tick_eula':'true',
  55. 'username':username,
  56. 'password':password,
  57. 'email':h.unescape(email1+email2),
  58. 'confirm_email':h.unescape(email1+email2),
  59. 'dob_month':'01',
  60. 'dob_day':'11',
  61. 'dob_year':'1977',
  62. 'gender':'male'
  63. }
  64.  
  65. url2 = 'https://www.spotify.com/us/xhr/json/sign-up-for-spotify.php'
  66. content = sess.post(url2, data=postparam, headers={"Referer": url}, cookies=cookies, verify=False)
  67. print content.content
Advertisement
Add Comment
Please, Sign In to add comment