arkadaşlar merhaba request öğrenmeye çalışıyorum böyle bir proje yaptım ama proxy desteği ekliyemedim yardım edebilcek varmı proxy desteği eklicem sonra thread modülü ile aynı anda işlem yapıcak mesela 10 tane aynı anda açıcak
import requests
import time
from mailtm import Email
import random
import string
from mailtm import Email
import re
# 2Captcha API anahtarınız
api_key = 'e3559fef8aa47e07930e354790e3076d'
def generate_password(length=8):
characters = string.ascii_letters + string.digits
password = ''.join(random.choice(characters) for i in range(length))
return password
password = generate_password()
with open("username.txt", "r") as file:
usernames = file.read().splitlines()
# Seçilen rastgele bir kullanıcı adı
username = random.choice(usernames)
def activate_account(url):
try:
response = requests.get(url)
account_file = "account.txt"
account_info = f"{user}:{password}"
with open(account_file, "a") as file:
file.write(account_info + "\n")
if response.status_code == 200:
print("Hesap başarıyla aktif hale getirildi.")
else:
print("Hesap aktifleştirme başarısız. HTTP Hatası:", response.status_code)
except Exception as e:
print("Hesap aktifleştirme sırasında bir hata oluştu:", str(e))
user = username
print(user)
def listener(message):
content = message['text'] if message['text'] else message['html']
if content:
time.sleep(2)
pattern = r'https://cracked\.io/member\.php\?action=activate&uid=\d+&code=\w+'
urls = re.findall(pattern, content)
if urls:
for url in urls:
print("Found URL:", url)
activate_account(url)
else:
print("No matching URL found in the email content")
# Get Domains
test = Email()
print("\nDomain: " + test.domain)
def create_email():
while True:
try:
test.register()
test.start(listener)
return str(test.address)
except requests.exceptions.HTTPError as e:
print("mail oluşturlamadı :", e)
print("tekrar deneniyor")
time.sleep(1)
mail = create_email()
print("\nEmail Address: " + mail)
# 2Captcha kullanarak CAPTCHA çözme işlemini tanımlayın
def captcha_coz(api_key, site_key, url):
captcha_veri = {
'key': api_key,
'method': 'userrecaptcha',
'googlekey': site_key,
'pageurl': url,
'json': 1,
}
yanit = requests.post('http://2captcha.com/in.php', data=captcha_veri)
talep_sonuc = yanit.json()
if talep_sonuc['status'] == 1:
# CAPTCHA başarıyla gönderildi, şimdi yanıtı alın
captcha_id = talep_sonuc['request']
for _ in range(30): # İhtiyaca göre yeniden deneme sayısını ayarlayın
yanit = requests.get(f'http://2captcha.com/res.php?key={api_key}&action=get&id={captcha_id}&json=1')
sonuc = yanit.json()
if sonuc['status'] == 1:
return sonuc['request']
elif sonuc['request'] == 'CAPCHA_NOT_READY':
# CAPTCHA hala çözülüyor, bir an bekleyin ve tekrar deneyin
time.sleep(5)
else:
# CAPTCHA çözme başarısız oldu
return None
# Headers ve verilerinizi tanımlayın
headers = {
'authority': 'cracked.io',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'accept-language': 'tr-TR,tr;q=0.9',
'cache-control': 'max-age=0',
'content-type': 'application/x-www-form-urlencoded',
'cookie': 'PHPSESSID=sjucop21pbnr2pcn9jeke9mgle; loginattempts=1; mybb[lastvisit]=1693394041; sid=eafaafa0be5b711e43211438db8075f2; cf_clearance=tELFL5lXqTKGE.HbOw7.rDIPNm137xwUTrXBmXp4BSM-1693395773-0-1-c44935ad.b3ad596b.79b9e1ab-0.2.1693395773; mybb[lastactive]=1693395867',
'origin': 'https://cracked.io',
'referer': 'https://cracked.io/member.php?action=register',
'sec-ch-ua': '"Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'same-origin',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
}
data = {
'regcheck1': '',
'regcheck2': 'true',
'username': user,
'email': mail,
'email2': mail,
'password': password,
'password2': password,
'referrername': '',
'Captcha': '',
'accept_terms': '1',
'regtime': '1693395773',
'step': 'registration',
'action': 'do_register',
'receivepms': '1',
'allownotices': '1',
'pmnotice': '1',
'regsubmit': 'Submit Registration'
}
# CAPTCHA site anahtarınız ve giriş URL'nizi tanımlayın
site_key = '6LfICGwdAAAAADhOg-AjpwXaOmwD7G9j-TiiT04p'
login_url = 'https://cracked.io/member.php'
# CAPTCHA'yı çözün
captcha_cevap = captcha_coz(api_key, site_key, login_url)
if captcha_cevap is not None:
# Veri sözlüğünüzü CAPTCHA yanıtıyla güncelleyin
print("CAPTCHA çözme Başarılı.")
data['g-recaptcha-response'] = captcha_cevap
# Güncellenmiş veri sözlüğünü kullanarak POST isteğini gönderin
yanit = requests.post(login_url, headers=headers, data=data)
if yanit.status_code == 200:
print("kayıt Başarılı")
pass
else:
print("Kayıt başarısız. HTTP 404 Hatası")
with open("username.txt", "w") as file:
for username in usernames:
if username != user:
file.write(username + "\n")
else:
print("CAPTCHA çözme başarısız oldu.")