Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
6.8 kB
2
Indexable
Never
from selenium import webdriver 
from time import  sleep 
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import random
import threading
import zipfile
import os


new_password_list = open('new password.txt','r',encoding='utf-8').readlines()
url1 = "https://www.spotify.com/tr/password-reset/" 
url2 = "https://yopmail.com/en/" 
extension_path = 'Noptcha--ReCAPTCHA---hCAPTCHA-Solver.crx'
host,port,user,passw = '','','',''
thread_sayisi = 2

manifest_json = """
    {
        "version": "1.0.0",
        "manifest_version": 2,
        "name": "Chrome Proxy",
        "permissions": [
            "proxy",
            "tabs",
            "unlimitedStorage",
            "storage",
            "<all_urls>",
            "webRequest",
            "webRequestBlocking"
        ],
        "background": {
            "scripts": ["background.js"]
        },
        "minimum_chrome_version":"22.0.0"
    }
    """

background_js = """
var config = {
    mode: "fixed_servers",
    rules: {
    singleProxy: {
        scheme: "http",
        host: "%s",
        port: parseInt(%s)
    },
    bypassList: ["localhost"]
    }
};

chrome.proxy.settings.set({value: config, scope: "regular"}, function() {});

function callbackFn(details) {
return {
    authCredentials: {
        username: "%s",
        password: "%s"
    }
};
}

chrome.webRequest.onAuthRequired.addListener(
        callbackFn,
        {urls: ["<all_urls>"]},
        ['blocking']
);
""" % (host,port,user,passw)

def log(browser,number,mail,message) :
    try:
        file=open('hata.txt','a',encoding='utf-8')
        file.write(f'{mail}   {message}\n')
        file.close()
        browser.quit()
        os.remove(f'proxy_auth_plugin{str(number)}.zip')
    
    except:
        pass

def main_function(number,mail,new_password,type_) :
    try:
        op = Options()
        try:
            pluginfile = f'proxy_auth_plugin{str(number)}.zip'
            with zipfile.ZipFile(pluginfile, 'w') as zp:
                zp.writestr("manifest.json", manifest_json)
                zp.writestr("background.js", background_js)
        except :
            pass
        
        op.add_extension(pluginfile)
        op.add_extension(extension_path)
        browser = webdriver.Chrome(options=op)
        sleep(2)
        try:
            browser.get(url2)
        except Exception as err :
            log(browser,number,mail,'Yopmail Alma Hatası.')
            return
            
        try:
            input_yopmail = browser.find_element(By.XPATH, "//*[@id='login']")
            input_yopmail.send_keys(mail)
        except:
            log(browser,number,mail,'Yopmail mail girme hatası')
            return
            
        try:
            send_yopmail = browser.find_element(By.XPATH, "//*[@id='refreshbut']/button/i")
            send_yopmail.click()
        except :
            log(browser,number,mail,'Yopmail yenileme hatası')
            return
        
        sleep(3)
        
        try:
            reset_password = browser.find_element(By.XPATH, "//*[@id='mail']/div/table/tbody/tr/td/div/table[4]/tbody/tr[2]/td[2]/p/a")
            reset_password.click()
        except Exception as err:
            log(browser,number,mail,'Parola sıfırlama tıklama hatası')
            return
        sleep(3)
        
        try:
            new_password = browser.find_element(By.XPATH, "//*[@id='form_new_password']")
            new_password.send_keys(new_password)
        except:
            log(browser,number,mail,'Parola sıfırlama  hatası')
            return
        sleep(1)
        
        try:
            new_password_check = browser.find_element(By.XPATH, "//*[@id='form_check_password']")
            new_password_check.send_keys(new_password)
        except:
            log(browser,number,mail,'Yeni parola girme hatası')
            return
        sleep(10)
        
        try:
            send_password = browser.find_element(By.XPATH, "//*[@id='form_send']")
            send_password.click()
        except:
            log(browser,number,mail,'Yeni parola gönderme hatası')
            return
        
        try:
            go_to_account = browser.find_element(By.XPATH, "//*[@id='content-main']/div/div/div/p/a")
            go_to_account.click()
        except:
            log(browser,number,mail,'Hesaba gitme hatası')
            return
        
        try:
            sign_out = browser.find_element(By.XPATH, "//*[@id='__next']/div/div/div[2]/div[2]/div[2]/div/div[2]/article/div[2]/a")
            sign_out.click()
        except:
            log(browser,number,mail,'Çıkış Yapma Hatası')
            return
        
        
        try:
            file=open('new datas (mail, pass, type).txt','a',encoding='utf-8')
            file.write(f'{mail}:{new_password}:{type_}\n')
            file.close()
        except:
            log(browser,number,mail,f'Yeni şifre kaydedilirken hata. Yeni şifre:{new_password}')
            return


        try :
            browser.quit()
        except:
            log(browser,number,mail,'Tarayıcı Kapatma Hatası')
            return
        
        try:
            os.remove(f'proxy_auth_plugin{str(number)}.zip')
        except:
            log(browser,number,mail,'zip silme hatası')
       
    except Exception as err:
        log(browser,number,mail,f'Genel Bir Hata Oluştu: {err}')



my_threads = []


totalline = len(open("datas (mail, pass, type).txt", "r").readlines())
index_no = 0

for kk in range(9999) :
    print('1:',index_no)
    if index_no == totalline  :
        break
    with open("datas (mail, pass, type).txt", "r") as fd:
        print('2:',index_no)
        satirlar = fd.readlines()
        if index_no + thread_sayisi > totalline :
            sira_no = totalline 
        else :
            sira_no = index_no+thread_sayisi
        for number,line in enumerate(satirlar[index_no:sira_no]):
            mail,password,type_ = line.replace('\n','').split(':') 
            random_new_password = random.choice(new_password_list).replace('\n','')            
            print('-> {}:{}:{}:{}'.format(mail,password,type_,random_new_password))
            if not line:
                continue
            
            if number == thread_sayisi :
                break
            
            index_no += 1
            t = threading.Thread(target=main_function, args=(number,mail,random_new_password,type_))
            t.start()
            my_threads.append(t)

    for t in my_threads:
        t.join()