OP 30 November, 2023 - 09:38 PM
Im trying to create an account creator for https://myanimelist.net/ but no matter what I do I cant get it to work.
Here is what I wrote so far
Any ideas or help appreciated
Here is what I wrote so far
Code:
import requests
import json
import cloudscraper
import urllib.parse
def generate_captcha():
anchor_url = "https://www.google.com/recaptcha/api2/anchor?ar=1&k=6Ld_1aIZAAAAAF6bNdR67ICKIaeXLKlbhE7t2Qz4&co=aHR0cHM6Ly9teWFuaW1lbGlzdC5uZXQ6NDQz&hl=en&v=-QbJqHfGOUB8nuVRLvzFLVed&size=invisible&cb=rqazcek22coy"
k = anchor_url.split('k=')[1].split("&")[0]
co = anchor_url.split("co=")[1].split("&")[0]
v = anchor_url.split("v=")[1].split("&")[0]
x = session.get(anchor_url).text
token = x.split('recaptcha-token" value="')[1].split('">')[0]
payload = {
"v": v,
"reason": "q",
"c": token,
"k": k,
"co": co,
"hl": "en",
"size": "invisible",
}
key = session.post(f"https://www.google.com/recaptcha/api2/reload?k={k}", data=payload)
return key.text.split('"rresp","')[1].split('"')[0]
def generate_data():
x = session.get('https://myanimelist.net/register.php?from=%2F')
csrf = x.text.split("name='csrf_token' content='")[1].split("'")[0]
return csrf, x.cookies
def run_validation(): # prob not needed
payload_email = f"email={email}"
payload_user = f"user_name={username}"
payload_password = f"password={password}&user_name={username}&email={email}"
headers = {
"Accept": "application/json, text/plain, */*",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"X-Csrf-Token": csrf,
"X-Referral-Path": "/register.php?from=%2F&",
"X-Requested-With": "XMLHttpRequest"
}
x = session.post("https://myanimelist.net/signup/username/validate", data=urllib.parse.urlencode(payload_user), headers=headers,
cookies=cookies)
y = session.post('https://myanimelist.net/signup/email/validate', data=urllib.parse.urlencode(payload_email), headers=headers,
cookies=cookies)
z = session.post('https://myanimelist.net/signup/password/validate', data=urllib.parse.urlencode(payload_password), headers=headers,
cookies=cookies)
print(x.status_code, y.status_code, z.status_code)
def create():
data = {
"email": email,
"user_name": username,
"password": password,
"birthday[day]": 11, # change this to nested dict later
"birthday[month]": 17,
"birthday[year]": 2006,
"agreement": 1,
"sns": "",
"csrf_token": csrf,
"g-recaptcha-response": generate_captcha()
}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
}
x = scraper.post("https://myanimelist.net/register.php?from=%2F", data=urllib.parse.urlencode(data), headers=headers, cookies=cookies)
return x.text
if __name__ == "__main__":
scraper = cloudscraper.create_scraper() # tried this bc it establishes an ssl context by default but it didn't work either
session = requests.Session()
email = "asaiaosbufabb@gmail.com"#.replace("@", "%40") # any email for now
username = "a0qashfoy72g" # Between 2 and 16 characters
password = "shduag7AA100!!" # 6 - 50 characters, at least two of the following: uppercase, lowercase, numbers and symbols
csrf, cookies = generate_data()
cr = create()
if "Junk" in cr: # when successful page will have a think telling you to check ur email/junk mail
print("Success")
else: # most commonly error 500 or try refreshing the page
print("Failed")
Any ideas or help appreciated
![[Image: pepeglad.png]](https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fstatic.cracked.sh%2Fimages%2Fsmilies%2Fpepeglad.png)