本帖最后由 苏紫方璇 于 2024-8-26 12:15 编辑
仅供学习参考禁止商业用途损害侵权!!!
仅供学习参考禁止商业用途损害侵权!!!
仅供学习参考禁止商业用途损害侵权!!!
偶然用到一款app不错用着可以便想着免受广告荼毒一生气写一个代码。分享下
[Python] 纯文本查看 复制代码 import requests
import random
import string
def generate_random_string(length, chars=string.ascii_letters + string.digits):
return ''.join(random.choice(chars) for _ in range(length))
def register_user():
url = ""
# 随机生成11位电话号码
name = ''.join(random.choice(string.digits) for _ in range(11))
# 随机生成8位密码(字母+数字)
password = generate_random_string(8)
# 复制密码到confirmPassword
confirm_password = password
# 随机生成device字符串
device = generate_random_string(32, chars=string.ascii_lowercase + string.digits)
# 手动输入yqm邀请码
yqm = ""
# POST请求的JSON数据
data = {
"name": name,
"password": password,
"confirmPassword": confirm_password,
"code": "",
"yqm": yqm,
"type": "noyzm",
"device": device
}
headers = {
"User-Agent": "Dart/2.10 (dart:io)",
"Content-Type": "application/json; charset=utf-8",
"Accept-Encoding": "gzip",
"Authorization": "",
"Host": ""
}
response = requests.post(url, json=data, headers=headers)
# 显示账号和密码
print(f"账号: {name}, 密码: {password}")
if response.status_code == 200:
print(f"注册成功: {response.json()}")
else:
print(f"注册失败: {response.status_code}, {response.text}")
def main():
try:
# 手动输入运行次数
run_times = int(input("请输入要运行的次数: "))
for i in range(run_times):
print(f"正在进行第 {i+1} 次注册...")
register_user()
print(f"第 {i+1} 次注册完成\n")
except ValueError:
print("请输入一个有效的数字。")
if __name__ == "__main__":
main() |