Advertisement
Guest User

untitled

a guest
Mar 10th, 2019
727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.26 KB | None | 0 0
  1. import requests import re import string import random import HTMLParser import json def id_generator(size=6, chars=string.ascii_uppercase + string.digits):     return ''.join(random.choice(chars) for _ in range(size)) username = "" while(1):   username = raw_input("What do you want your username to be? ")  r = requests.get("https://www.spotify.com/us/xhr/json/isUsernameAvailable.php?username=" + username, verify=False)  if r.content == "true":         print("The username is available")      break   else:       print("It's not available") """email = "" while(1):     email = raw_input("What do you want your username to be? ")     r = requests.get("https://www.spotify.com/us/xhr/json/isEmailAvailable.php?email=" + email)     if r.content == "true":         print("The email is available")         break   else:       print("It's not available")""" password = raw_input("What do you wish your password to be? ") realemail = username + id_generator() url = "http://www.yopmail.com/en/?" + realemail r = requests.get(url, verify=False) regex = re.search(r'<span class="nw b" id="autoaltcpt"><em>(.*?)</em>(.*?)</span>', r.content) email1 = regex.group(1) email2 = regex.group(2) h = HTMLParser.HTMLParser() cookies = { } url = "https://www.spotify.com/us/signup/?forward_url=%2Fus%2Faccount%2Foverview%2F" sess = requests.session() 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" resp = sess.get(url, verify=False) url = resp.url page = resp.content auth1 = resp.cookies['sp_csrf'] for keys in resp.cookies.keys():     cookies[keys] = resp.cookies[keys] #auth1 = re.search(r'class="js-sp-csrf" name="sp_csrf" type="hidden" value="(.*?)">', page).group(1) auth2 = re.search(r'name="form_token" type="hidden" value="(\w+)">', page).group(1) postparam = { 'sp_csrf':auth1, 'form_token':auth2, 'creation_flow':'', 'forward_url':'/us/account/overview/', 'signup_pre_tick_eula':'true', 'username':username, 'password':password, 'email':h.unescape(email1+email2), 'confirm_email':h.unescape(email1+email2), 'dob_month':'01', 'dob_day':'11', 'dob_year':'1977', 'gender':'male' } url2 = 'https://www.spotify.com/us/xhr/json/sign-up-for-spotify.php' content = sess.post(url2, data=postparam, headers={"Referer": url}, cookies=cookies, verify=False) print content.content
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement