import pyautogui,os,time,subprocess,random,pyotp,re,pyperclip import cv2### import numpy as np from pyzbar.pyzbar import decode import os#test y import pandas as pd import requests import random import string import random import string from time import * import os,re import shutil import json from seleniumbase import Driver from selenium import webdriver from selenium.webdriver.common.by import By import requests from datetime import datetime from selenium.webdriver.common.keys import Keys from time import sleep import pyautogui from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By import random import random import string,multiprocessing import pyotp import time import os import pytz from datetime import datetime import subprocess import os import openpyxl from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains import pyotp import os import psycopg2 from psycopg2.pool import SimpleConnectionPool from psycopg2 import OperationalError from typing import List, Optional from datetime import datetime import json import time import logging from pickle import FALSE from time import sleep from bs4 import BeautifulSoup import requests tehran = pytz.timezone('Asia/Tehran') tehran_time = datetime.now(tehran) import json,random import os,sys import requests from dotenv import load_dotenv, dotenv_values load_dotenv() from datetime import datetime import pytz import pandas as pd import psycopg2 import time from typing import List, Optional import logging import json from datetime import datetime import os from dotenv import load_dotenv import psycopg2 import time from typing import List, Optional import logging import json from datetime import datetime import os import os import json import time import re from pathlib import Path from camoufox.sync_api import Camoufox import pdb #from playwright.sync_api import Keys import time def get_tehran_time(): tehran_tz = pytz.timezone('Asia/Tehran') tehran_time = datetime.now(tehran_tz) return tehran_time.strftime('%Y-%m-%d %H:%M:%S') # استفاده از تابعf print(get_tehran_time()) import psutil def kill_tor_browser(): # جستجو برای پروسههای با نام "tor" یا "firefox" (چون Tor معمولاً روی Firefox اجرا میشه) for proc in psutil.process_iter(['pid', 'name']): try: # اگر نام پروسه "tor" یا "firefox" باشه، اون رو میبندیم if 'tor' in proc.info['name'].lower() or 'firefox' in proc.info['name'].lower(): print(f"پیدا شد: {proc.info['name']} (PID: {proc.info['pid']})") proc.kill() # بستن پروسه print(f"پروسه با PID {proc.info['pid']} بسته شد.") else: pass except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): pass # اگر دسترسی نداریم یا پروسه دیگهای از بین رفته باشه، نادیده میگیریم print("تمام پروسههای مرتبط با تور بررسی شدند.") import time import platform def minimize_camoufox(title_hint=None, profile_path=None, wait=0.3): """ ویندوز: پنجره Camoufox/Firefox را مینیمایز میکند. - title_hint: رشتهای از عنوان پنجره (مثلاً "Camoufox" یا نام پروفایل) - profile_path: اگر مسیر پروفایل را میدانی، کمک میکند PID درست پیدا شود (اختیاری) خروجی: True اگر موفق شود، وگرنه False """ if platform.system().lower() != "windows": return False # سعی 1: با عنوان پنجره (سریع و ساده) try: import pygetwindow as gw titles = gw.getAllTitles() if title_hint: candidates = [t for t in titles if t and title_hint.lower() in t.lower()] else: # اگر هینت ندادید، «Camoufox» را هدف میگیرد candidates = [t for t in titles if t and "camoufox" in t.lower()] for t in candidates: try: w = gw.getWindowsWithTitle(t)[0] w.minimize() time.sleep(wait) return True except Exception: continue except Exception: # pygetwindow نصب نیست یا مشکلی داشت -> میریم سراغ روش بعدی pass # سعی 2: با PID پروسه و مینیمایز همهی hwndهای مربوط (پایدارتر) try: import psutil import win32gui, win32con, win32process target_pids = set() # پیدا کردن پروسهها از روی نام/cmdline for proc in psutil.process_iter(['pid','name','cmdline']): try: name = (proc.info.get('name') or '').lower() cmd = ' '.join(proc.info.get('cmdline') or []).lower() good_name = ('camoufox' in name) or ('camoufox' in cmd) or ('firefox' in name) good_profile = (profile_path and profile_path.lower() in cmd) # اگر نام درست بود، یا مسیر پروفایل در cmdline دیده شد، این PID را هدف بگیر if good_name or good_profile: target_pids.add(proc.info['pid']) except (psutil.NoSuchProcess, psutil.AccessDenied): continue if not target_pids: return False hwnds = [] def enum_handler(hwnd, result_list): try: _, pid = win32process.GetWindowThreadProcessId(hwnd) if pid in target_pids and win32gui.IsWindowVisible(hwnd) and win32gui.GetWindowText(hwnd): result_list.append(hwnd) except Exception: pass win32gui.EnumWindows(enum_handler, hwnds) if not hwnds: time.sleep(0.5) win32gui.EnumWindows(enum_handler, hwnds) if not hwnds: return False ok = False for h in hwnds: try: win32gui.ShowWindow(h, win32con.SW_MINIMIZE) ok = True except Exception: continue time.sleep(wait) return ok except Exception: return False file_data={} class EmailGroupManager: def __init__(self, db_config: dict, log_file='logs/email_service.log'): self.db_config = db_config self.pool = None self.connect() def connect(self): while True: try: self.pool = SimpleConnectionPool(minconn=1, maxconn=10, **self.db_config) if self.pool: print("اتصال به دیتابیس (با Pool) برقرار شد") break except Exception as e: print(f"اتصال به دیتابیس ناموفق بود: {e} – تلاش مجدد در ۵ ثانیه...") time.sleep(5) def get_connection(self): try: conn = self.pool.getconn() with conn.cursor() as cur: cur.execute("SELECT 1") return conn except Exception as e: print(f"[get_connection] خطا در گرفتن کانکشن اول: {e}") self.connect() for i in range(3): # سه بار سعی مجدد try: conn = self.pool.getconn() with conn.cursor() as cur: cur.execute("SELECT 1") return conn except Exception as e: print(f"[get_connection] تلاش مجدد #{i+1} برای گرفتن کانکشن: {e}") time.sleep(5) print("[get_connection] سه بار تلاش کردیم ولی نشد. دیتابیس در دسترس نیست.") raise Exception("اتصال به دیتابیس ممکن نیست") def release_connection(self, conn): if conn: self.pool.putconn(conn) def get_open_groups_1(self, server_name: str): conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" SELECT * FROM ea_shadow_tactics WHERE server_name = %s AND (is_finished IS NULL OR is_finished IS DISTINCT FROM TRUE) AND (login_status = TRUE OR login_status IS NULL) AND group_id IS NOT NULL """, (server_name,)) return cur.fetchall() finally: self.release_connection(conn) def has_open_group(self, server_name: str) -> bool: conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" SELECT COUNT(*) FROM ea_shadow_tactics WHERE server_name = %s AND (is_finished IS DISTINCT FROM TRUE AND login_status IS DISTINCT FROM FALSE) AND group_id IS NOT NULL """, (server_name,)) return cur.fetchone()[0] > 0 finally: self.release_connection(conn) def get_next_group_id(self, server_name: str) -> int: conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" SELECT COALESCE(MAX(group_id), 0) + 1 FROM ea_shadow_tactics WHERE server_name = %s """, (server_name,)) return cur.fetchone()[0] finally: self.release_connection(conn) def set_taken_at(self, email_id: int): conn = self.get_connection() tehran_time = datetime.now(tehran) tehran_tz = pytz.timezone('Asia/Tehran') tehran_time = datetime.now(tehran_tz).replace(tzinfo=None) try: with conn.cursor() as cur: cur.execute(""" UPDATE ea_shadow_tactics SET taken_at = %s WHERE id = %s """, (tehran_time, email_id)) conn.commit() print(f"taken_at ست شد برای ایمیل با id={email_id}") finally: self.release_connection(conn) def assign_new_group_old(self, server_name: str, group_id: int) -> List[dict]: conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" WITH next_emails AS ( SELECT id FROM ea_shadow_tactics WHERE taken_at IS NULL AND server_name IS NULL AND (is_finished IS NULL OR is_finished IS DISTINCT FROM TRUE) AND login_status IS DISTINCT FROM FALSE ORDER BY id LIMIT 5 FOR UPDATE SKIP LOCKED ) UPDATE ea_shadow_tactics SET taken_at = NOW(), server_name = %s, group_id = %s WHERE id IN (SELECT id FROM next_emails) RETURNING id, email, email_password, back_up_mail, seler_name, group_id """, (server_name, group_id)) rows = cur.fetchall() conn.commit() return [ { "id": row[0], "email": row[1], "email_password": row[2], "back_up_mail": row[3], "seler_name": row[4], "group_id": row[5] } for row in rows ] finally: self.release_connection(conn) def assign_new_group(self, server_name: str, group_id: int) -> List[dict]: conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" WITH next_emails AS ( SELECT id FROM ea_shadow_tactics WHERE taken_at IS NULL AND server_name IS NULL AND (is_finished IS NULL OR is_finished IS DISTINCT FROM TRUE) AND login_status IS DISTINCT FROM FALSE ORDER BY id LIMIT 5 FOR UPDATE SKIP LOCKED ) UPDATE ea_shadow_tactics SET server_name = %s, group_id = %s WHERE id IN (SELECT id FROM next_emails) RETURNING id, email, email_password, back_up_mail, seler_name, group_id """, (server_name, group_id)) rows = cur.fetchall() conn.commit() return [ { "id": row[0], "email": row[1], "email_password": row[2], "back_up_mail": row[3], "seler_name": row[4], "group_id": row[5] } for row in rows ] finally: self.release_connection(conn) def get_group(self, server_name: str) -> List[dict]: try: if self.has_open_group(server_name): print(f"سرور {server_name} هنوز گروه قبلی را کامل نکرده است") return [] group_id = self.get_next_group_id(server_name) group = self.assign_new_group(server_name, group_id) if not group: print(f"برای سرور {server_name} دیتایی برای تخصیص یافت نشد") else: print(f"گروه جدید برای {server_name} ثبت شد. group_id={group_id}") return group except Exception as e: print(f"خطا در دریافت گروه برای {server_name}: {e}") return [] def update_login_status(self, email_id: int, success: bool, error_message: Optional[str] = None): conn = self.get_connection() try: with conn.cursor() as cur: if success: cur.execute(""" UPDATE ea_shadow_tactics SET login_status = TRUE, error_message = NULL WHERE id = %s """, (email_id,)) print(f"ایمیل با id={email_id} با موفقیت لاگین شد.") else: cur.execute(""" UPDATE ea_shadow_tactics SET login_status = FALSE, error_message = %s WHERE id = %s """, (error_message, email_id)) print(f"ایمیل با id={email_id} لاگین ناموفق داشت. پیام خطا: {error_message}") conn.commit() finally: self.release_connection(conn) def append_to_history(self, email_id: int, message: str): conn = self.get_connection() try: with conn.cursor() as cur: timestamp = datetime.utcnow().isoformat() cur.execute(""" UPDATE ea_shadow_tactics SET history = COALESCE(history, '{}'::jsonb) || %s::jsonb WHERE id = %s """, (json.dumps({timestamp: message}), email_id)) conn.commit() print(f"history آپدیت شد برای ایمیل id={email_id}") finally: self.release_connection(conn) def mark_email_finished(self, email_id: int, success: bool, backup_code: Optional[str] = None): conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" UPDATE ea_shadow_tactics SET is_finished = TRUE, finished_at = NOW(), login_status = %s, backup_code = %s WHERE id = %s """, (success, backup_code, email_id)) conn.commit() print(f"ایمیل با id={email_id} با وضعیت login_status={success} فینیش شد.") finally: self.release_connection(conn) def mark_email_finished_nime(self, email_id: int, success: bool, backup_code: Optional[str] = None): conn = self.get_connection() try: with conn.cursor() as cur: cur.execute(""" UPDATE ea_shadow_tactics SET is_finished = TRUE, finished_at = NOW(), login_status = %s, backup_code = %s WHERE id = %s """, (False, 'ea_created__app_code_nead', email_id)) conn.commit() print(f"ایمیل با id={email_id} با وضعیت login_status={success} فینیش شد.") finally: self.release_connection(conn) ip_v2ray='http://127.0.0.1:2017' class pool(): def __init__(self) -> None: self.MAX_IP=[]#['1','2','65',',64'] self.ip='http://127.0.0.1:2017' #self.auto=auto url = f'{ip_v2ray}/api/login' headers = { 'Accept': 'application/json, text/plain, */*', 'Accept-Language': 'fa-IR,fa;q=0.9,en-US;q=0.8,en;q=0.7,fr;q=0.6', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Origin': f'{ip_v2ray}', 'Referer': f'{ip_v2ray}/', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' } data = { 'username': 'zxczxc', 'password': 'zxczxc' } response = requests.post(url, headers=headers, json=data, verify=False) self.heders={'Authorization':json.loads(response.text)["data"]['token']} def dell_all(self): while True: try: ret=json.loads(requests.get(f'{self.ip}/api/touch', headers=self.heders, verify=False).text)['data']['touch']['servers'] break except Exception as e: print(e) sst+=1 if sst==20: return False for i in range(0,len(ret)+1): url = f'{self.ip}/api/touch' data = { 'touches': [ {'id': i, '_type': 'server'}, ] } #'{"touches":[{"id":1,"_type":"server"}]}' requests.delete(url, headers=self.heders, json=data) sleep(0.5) while True: try: ret=json.loads(requests.get(f'{self.ip}/api/touch', headers=self.heders, verify=False).text)['data']['touch']['servers'] print(len(ret),'***') if len(ret)==0: return True else: self.dell_all() #input('-------------') except Exception as e: print(e) sst+=1 if sst==20: return False def dell(self): url = f'{self.ip}/api/touch' data = { 'touches': [ {'id': 1, '_type': 'server'}, ] } requests.delete(url, headers=self.heders, json=data) def add_config(self,url): sst=0 while True: try: return requests.post(f'{self.ip}/api/import',json={"url":url},headers=self.heders).text except Exception as e: print(e) sst+=1 if sst==20: return False def number_cont(self): while True: try: url = f'{self.ip}/api/touch' response = json.loads(requests.get(url, headers=self.heders, verify=False).text)['data']['touch']['servers'] #return response#.text break except Exception as e: print(e) pass for i in response: if 'ms' in i['pingLatency']: while True: try: ids=i['id'] response =json.loads(requests.get('%s/api/sharingAddress?touch={"id":%s,"_type":"server"}'%(self.ip,ids), headers=self.heders, verify=False).text)['data']['sharingAddress'] print(response) self.MAX_IP.append(response) #return response#.text break except Exception as e: print(e) pass #@self.MAX_IP.append(response) else: continue #http://172.16.0.182:2014/api/sharingAddress?touch={"id":1,"_type":"server"} # response = requests.get(url, headers=self.heders, verify=False) # اینجا verify=False به عنوان گزینهای برای نادیده گرفتن گواهینامه SSL استفاده شده است. لطفا توجه داشته باشید که این روش امنیتی به خطر افتاده و باید به دلایل امنیتی دقت کنید. #return response.text def chek_config_all(self): #url = f'{self.ip}/api/httpLatency?whiches=[{xsx}]' # row=[] #payload = {'whiches':[row]} while True: try: ret=json.loads(requests.get(f'{self.ip}/api/touch', headers=self.heders, verify=False).text)['data']['touch']['servers'] break except Exception as e: print(e) sst+=1 if sst==20: return False dataID = "" for ranger in range(len(ret)): dataID += f"%7B%22id%22:{ranger+1},%22_type%22:%22server%22,%22sub%22:null%7D," url = self.ip+f'/api/httpLatency?whiches=[{dataID}]' urlss = url[0:-2]+"]" res = requests.get(urlss,headers=self.heders).text print(res) return res def chek_config(self): sleep(2) #url=f'{self.ip}/api/httpLatency?whiches=\[{"id":1,"_type":"server","sub":null}\]' url = f'{self.ip}/api/httpLatency?whiches=[%7B%22id%22:1,%22_type%22:%22server%22,%22sub%22:null%7D]' sdx=0 while True: try: return json.loads(requests.get(url,headers=self.heders).text)['data']['whiches'][0]['pingLatency'] except Exception as e: print(e) sdx+=1 if sdx==20: return False def selct(self): data = { 'id': 1, '_type': 'server', 'outbound': 'proxy'} url = f'{self.ip}/api/connection' while True: try: return requests.post(url, headers=self.heders, json=data).text except Exception as e: print(e) def run_core(self): url = f'{self.ip}/api/v2ray' while True: try: return requests.post(url, headers=self.heders).text except Exception as e: print(e) def stop_core(self): url = f'{self.ip}/api/v2ray' while True: try: return requests.delete(url, headers=self.heders).text except Exception as e: print(e) def chek_2_1(self): #self.dell_all() self.dell_all() self.dell_all() self.dell_all() while True: self.dell_all() self.dell_all() batch_data = self.read_and_remove_batch_2() self.dell_all() print(len(batch_data)) print('--------') print('--------') print('--------') print('--------') print('--------') print('--------') print('--------') print('--------') #input('--------') for ixc in batch_data: print(ixc) bnbs=self.add_config(str(ixc)) print(bnbs) if bnbs==False: self.dell_all() continue sleep(2) pr=self.chek_config() print(pr) if pr==False: self.dell_all() continue if 'ms' in pr: print(pr,'*******') print(self.selct()) sleep(2) print(self.run_core()) #input('>xxxxxx>') return True self.dell() def chek_2_2(self,url): self.dell_all() self.dell_all() self.dell_all() while True: bnbs=self.add_config(str(url)) if bnbs==False: self.dell_all() return 'add_fail' print('add') break pr=self.chek_config_all() sleep(5) if pr==False: self.dell_all() return 'chek_config_all_fail' if 'ms' in pr: print(pr,'*******') print(self.selct()) sleep(2) print(self.run_core()) #input('>xxxxxx>') return True return False class ea_fucking(): def __init__(self,path_png_file): self.path_png_file=path_png_file def qr_code(self): sleep(3) pyautogui.screenshot(os.path.join(os.getcwd(),'image.png')) image_path = "image.png" # مسیر عکس رو مشخص کن image = cv2.imread(image_path) # --- اسکن QR Code --- qr_codes = decode(image) try:os.remove("image.png") except:pass for qr in qr_codes: qr_text = qr.data.decode("utf-8").split('?secret=')[1].split('&issuer=Electronic%20Arts')[0] print("QR Code Data:", qr_text) return qr_text if not qr_codes: return False print("هیچ QR Codeای پیدا نشد!") def top(self,secret): secret=secret.replace(' ','',100) totp = pyotp.TOTP(secret) try: while True: # Get the current OTP current_otp = totp.now() # Clear the console output #os.system('cls' if os.name == 'nt' else 'clear') # Display the current OTP print(f"Current OTP: {current_otp}") return current_otp # Show time remaining for the next OTP update (default interval is 30 seconds) time_remaining = 30 - (int(time.time()) % 30) print(f"Time remaining: {time_remaining} seconds") # Wait 1 second before updating time.sleep(1) #input(">>") except KeyboardInterrupt: print("\nProcess stopped by user.") def load_browser_windows(self,path): # print(codex,'--------------') print(path) minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") path=rf'C:\Users\{user_sys}\Desktop\Browser\firefox.exe' subprocess.Popen([path]) time.sleep(6) #pyautogui.press("f11") # pyautogui.write("https://ea.com") pyautogui.press("enter") time.sleep(6) pyautogui.press("enter") return True def get_tor(self): pyautogui.press('enter') pyautogui.press('enter') # pyautogui.hotkey('ctrl', 'shift', 'n') # pyautogui.press("f11") time.sleep(2) # pyautogui.write("https://ea.com") # time.sleep(2) #tottotttpyautogui.press("enter") time.sleep(4) for i in range(5): print(os.path.join(self.path_png_file,r'1_dcuk_clik.PNG')) ##import pdb;pdb.set_trace() try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'2_dcuk_clik.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'1_1_dcuk_clik.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'1_dcuk_clik.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except: pass except Exception as e: print(e) time.sleep(5) continue #import pdb;pdb.set_trace() if location: pyautogui.click(pyautogui.center(location)) return True else: print("1 تصویر مورد نظر پیدا نشد.") return False def disabel(self): sleep(4) pyautogui.write("about:config") pyautogui.press("enter") # about:config for i in range(5): print(os.path.join(self.path_png_file,r'accept.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'accept.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'accept.PNG'), confidence=0.8) except Exception as e: time.sleep(5) continue if location: pyautogui.click(pyautogui.center(location)) # accept.PNG pyautogui.write("privacy.firstparty.isolate") sleep(1) for i in range(10): print(os.path.join(self.path_png_file,r'true.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'True.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'true2.PNG'), confidence=0.8) except Exception as e: time.sleep(5) continue if location: pyautogui.click(pyautogui.center(location)) sleep(4) pyautogui.hotkey('ctrl', 't') sleep(2) return True def get_to_ea(self): pyautogui.write("https://myaccount.ea.com/cp-ui/security/index") pyautogui.press("enter") time.sleep(15) for i in range(20): print(os.path.join(self.path_png_file,r'click_gmail.PNG')) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_make_other_time.PNG'), confidence=0.8) return 'ea_created__app_code_nead!!' except: pass try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'click_gmail.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'click_gmail.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) time.sleep(10) return True except Exception as e: time.sleep(5) continue return 'click_gmail' def clik_extenshen(self,get_cookes): chek='' for i in range(20): print(os.path.join(self.path_png_file,r'extenshen.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'extenshen.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'extenshen.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) chek=True break except Exception as e: time.sleep(5) continue if chek==True: pass else: return 'extenshen' chek2='' for i in range(10): print(os.path.join(self.path_png_file,r'cookes.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'cookes.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'cookes.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) chek2=True break except Exception as e: time.sleep(5) continue if chek2==True: pass else: return 'cookes' sleep(20) chek3='' for i in range(30): print(os.path.join(self.path_png_file,r'del.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'del.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'del.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) chek3=True break except Exception as e: time.sleep(5) continue if chek3==True: pass else: return 'del' sleep(3) chek4='' for i in range(10): print(os.path.join(self.path_png_file,r'import2.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'import2.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'import2.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) chek4=True break except Exception as e: time.sleep(6) continue if chek4==True: pass else: return 'import2' chunk_size = 100 # تعداد کاراکترهایی که در هر مرحله تایپ میشوند for i in range(0, len(get_cookes), chunk_size): chunk = get_cookes[i:i + chunk_size] # گرفتن ۵۰ کاراکتر از متن pyautogui.write(chunk) # تایپ کردن بخش مورد نظر time.sleep(0.1) # تاخیر برای طبیعیتر شد '''for ixx in get_cookes:y0MAZ24g # pyautogui.write(ixx)''' time.sleep(3) # input('>>>>>>>>>>>>Sssss') #time.sleep(4) chek45='' for i in range(10): print(os.path.join(self.path_png_file,r'import2.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'import2.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'import2.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) chek45=True break except Exception as e: time.sleep(5) continue if chek45==True: pass else: return 'import2' time.sleep(10) pyautogui.hotkey('ctrl', 'r') time.sleep(10) #input('>>>>>>>>>>>>Sssss') time.sleep(3) pyautogui.hotkey('ctrl', 'w') time.sleep(3) return True def click_gmail(self): sleep(5) for i in range(20): print(os.path.join(self.path_png_file,r'click_gmail.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'clik_fail_gmail.PNG'), confidence=0.8) return except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'click_gmail.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'click_gmail.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(5) continue return 'click_gmail' def chek_logo(self): cont=0 sleep(30) #input('2222') for i in range(15): #fail_mail.PNG print(os.path.join(self.path_png_file,r'ea_logo.PNG')) try: print('start chek') location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chalenge1_find_next.PNG'), confidence=0.8) if location: return 'jump_to_sec' except: pass try: print('start chek') location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'fail_mail.PNG'), confidence=0.8) if location: return 'fail_mail' except: pass try: print('start chek') location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) if location: return 'nime' except: pass try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'ea_logo.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'ea_logo.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) break except Exception as e: time.sleep(1) try: print('start chek') location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) if location: return 'nime' except: pass cont+=1 if cont>5: return False continue cont+=1 if cont>5: return False try: print('start chek') location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) if location: return 'nime' except: pass ##import pdb;pdb.set_trace() sleep(6) pyautogui.press('tab')#, sleep(1) pyautogui.press('tab') sleep(1) pyautogui.press("enter") pyautogui.press("enter") pyautogui.press("enter") sleep(5) return True def continue_page(self): sleep(20) for i in range(15): try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'ok_maker.PNG'), confidence=0.8) if location: # pyautogui.click(pyautogui.center(location)) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'ea_logo.PNG'), confidence=0.8) print('ea_logo boadddddddddd') except: return 'nime' except: print('nime >>> ok_maker.PNG') print(os.path.join(self.path_png_file,r'contnue_persain.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'conntinueee.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'continue_en.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(4) continue return 'conntinueee' def input_PATRH(self): sleep(5) for i in range(15): print(os.path.join(self.path_png_file,r'input.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'input.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'input.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(5) continue return 'input' def contuen_page2(self): sleep(10) for i in range(15): print(os.path.join(self.path_png_file,r'contnue_persain.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'conntinueee.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'continue_en.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(5) continue return 'contnue_persain' def next(self): for i in range(15): print(os.path.join(self.path_png_file,r'next.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(5) continue #return True def accept(self): sleep(10) for i in range(1,5): print(os.path.join(self.path_png_file,r' ========= accept >>> next.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'next.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) break except Exception as e: time.sleep(5) continue sleep(20) for i in range(15): #for i in range(1,4): try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'10_accept.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except: print('fail >>> 10_accept.PNG') pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'10_accept_1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except: print('fail >>> 10_accept_1.PNG') try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'10_accept_2.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except: print('fail >>> 10_accept_1.PNG') try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'ok_maker.PNG'), confidence=0.8) if location: # pyautogui.click(pyautogui.center(location)) return 'make_other_time' except: print('make_other_time >>> ok_maker.PNG') # 10_accept return 'fail_10_acceptt' def creat(self): for i in range(15): print(os.path.join(self.path_png_file,r'11_create_account.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'11_create_account.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'11_create_account.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(5) continue return 'fail_11_create_account' def finsh(self): for i in range(15): print(os.path.join(self.path_png_file,r'13finsh13.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'13finsh13.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'13finsh13.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) time.sleep(15) return True except Exception as e: time.sleep(5) continue return 'fail_13finsh13' '''input('>>>>>>>>>>>>Sssss') input('>>>>>>>>>>>>Sssss') input('>>>>>>>>>>>>Sssss') pyautogui.hotkey('ctrl', 't') sleep(1) pyautogui.write("about:config") pyautogui.press("enter") sleep(2) for i in range(5): print(os.path.join(self.path_png_file,r'accept.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'accept.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'accept.PNG'), confidence=0.8) except Exception as e: time.sleep(3) continue if location: pyautogui.click(pyautogui.center(location)) # accept.PNG pyautogui.write("privacy.firstparty.isolate") sleep(1) for i in range(10): print(os.path.join(self.path_png_file,r'false2.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'false2.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'false.PNG'), confidence=0.8) except Exception as e: time.sleep(5) continue if location: pyautogui.click(pyautogui.center(location)) #extenshen.PNG #privacy.firstparty.isolat # e''' def get_seting_sec_1(self): return True for i in range(15): print(os.path.join(self.path_png_file,r'click_hhtt.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'click_hhtt.PNG'), confidence=0.8) except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'click_hhtt.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.hotkey('ctrl', 'a') pyautogui.write('https://myaccount.ea.com/cp-ui/security/index') sleep(1) pyautogui.press("enter") return True except Exception as e: time.sleep(5) continue return 'fail_click_hhtt' # https://myaccount.ea.com/cp-ui/aboutme/index def get_turn_on_2(self,codex,value,val2): for i in range(4): print(os.path.join(self.path_png_file,r'14_tron_on.PNG')) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_make_other_time.PNG'), confidence=0.8) return 'ea_created__app_code_nead!!' except: pass for i in range(9): print(os.path.join(self.path_png_file,r'chalenge1_find_next.PNG')) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chalenge1_find_next.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) print(' ok >>> chalenge1_find_next') #return 'ea_created__app_code_nead!!' except: print(' eror >>> chalenge1_find_next') pass sleep(55) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True except:pass # codex.end() # codex=Gmail(value,val2,browser_proxy=browser_proxy) codes='' for isx in range(4): if self.dicline()=='Internal Server Error':return 'Internal Server Error'#=='Internal Server Error':return 'Internal Server Error' for i in range(2): try: code=codex.get_code()#str(re.findall(pattern=r'Your EA Security Code is: \w*',string=copied_text)[0]).replace('Your EA Security Code is: ','') if 'ALERT_to_mnay_code_chek'==code: return 'ALERT_to_mnay_code_chek' if code=='continue': codex.end() codexs=Gmail(value,val2,browser_proxy=browser_proxy) code=codexs.get_code() if 'ALERT_to_mnay_code_chek'==code: return 'ALERT_to_mnay_code_chek' if code=='continue': continue codes=True codes=True #break #codex.end() except: codex.end() codex=Gmail(value,val2,browser_proxy=browser_proxy) print('eror') ##import pdb;pdb.set_trace() print('break_one') if codes==True: pass else: return 'fail_get_code_new_EROR' for i in code: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'6code_.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) except: pass pyautogui.write(i) sleep(0.5) pyautogui.press('enter') sleep(15) ################ try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_1.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_2.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_3.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_4.PNG'), confidence=0.8) if location: return True except: pass ################ try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True except:pass sleep(5) print('start >>> chek_True_1') if self.dicline()=='Internal Server Error':return 'Internal Server Error' try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True except:pass print('fail >>> chek_True_1') print('start >>> chek_True_2') if self.dicline()=='Internal Server Error':return 'Internal Server Error' try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True except:pass print('fail >>> chek_True_1') if self.dicline()=='Internal Server Error':return 'Internal Server Error' try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_eror.PNG'), confidence=0.8) if location: pass else: sleep(10) location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_eror.PNG'), confidence=0.8) if location: pass else: return True location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True sleep(2) location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_2.PNG'), confidence=0.8) if location: return True except:pass ################################### try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_1.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_2.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_3.PNG'), confidence=0.8) if location: return True except:pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek____true_4.PNG'), confidence=0.8) if location: return True except:pass ##################################### if self.dicline()=='Internal Server Error':return 'Internal Server Error' codex.end() codex=Gmail(value,val2,browser_proxy=browser_proxy) return 'fail_14_tron_on' def get_send_sec_3(self): sleep(10) if self.dicline()=='Internal Server Error':return 'Internal Server Error' for i in range(10): try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'14_tron_on.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) except: pass for i in range(15): if self.dicline()=='Internal Server Error':return 'Internal Server Error' print(os.path.join(self.path_png_file,r'15_send_sec_code_app_code.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) except: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_True_1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) except: pass if location: pyautogui.click(pyautogui.center(location)) for i in range(6): try: # towfacktor.PNG location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'towfacktor.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') pyautogui.press('enter') print('find towfacktor !!!!!!!!!!!!') break # print('find towfacktor !!!!!!!!!!!!') except: pass pyautogui.press('tab') sleep(0.5) pyautogui.press('enter') # return True sleep(10) for i in range(10): try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'send_code_new.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except: pass except Exception as e: time.sleep(5) continue return 'fail_15_send_sec_code_app_code' # https://myaccount.ea.com/cp-ui/aboutme/index def handel_page_and_code_send_code(self,codex,value,val2): sleep(30) codes='' for i in range(2): try: code=codex.get_code()#str(re.findall(pattern=r'Your EA Security Code is: \w*',string=copied_text)[0]).replace('Your EA Security Code is: ','') if 'ALERT_to_mnay_code_chek'==code: return 'ALERT_to_mnay_code_chek' if code=='continue': codex.end() codexs=Gmail(value,val2,browser_proxy=browser_proxy) code=codexs.get_code() if 'ALERT_to_mnay_code_chek'==code: return 'ALERT_to_mnay_code_chek' if code=='continue': codexs.end() continue return code codes=True return code except: codex.end() codex=Gmail(value,val2,browser_proxy=browser_proxy) print('eror') ##import pdb;pdb.set_trace() return 'fail_get_code' def handel_page_and_code_write_code(self,code): chek='' for i in range(30): print(os.path.join(self.path_png_file,r'veryfy_idyntt.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'veryfy_idyntt.PNG'), confidence=0.8) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'veryfy_idyntt.PNG'), confidence=0.8) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'veryfy_idyntt.PNG'), confidence=0.8) except: pass if location: pyautogui.click(pyautogui.center(location)) for i in range(3): pyautogui.press('tab') sleep(0.5) for i_code in code: pyautogui.write(i_code.replace('EA','')) print('handel_page_and_code mission 21 next !!!!') pyautogui.press('tab') pyautogui.press('enter') sleep(5) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_invalid_2.PNG'), confidence=0.8) print( 'code chek_invalid_2.PNG fail continue ...') for ix in range(4): pyautogui.press('tab') sleep(0.5) pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') continue except: pass sleep(5) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'invalid_chek.PNG'), confidence=0.8) print( 'code chek_invalid_2.PNG fail continue ...') for ix in range(4): pyautogui.press('tab') sleep(0.5) pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') continue except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_invalid_2.PNG'), confidence=0.8) print( 'code chek_invalid_2.PNG fail continue ...') for ix in range(4): pyautogui.press('tab') sleep(0.5) pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') continue except: pass if location: pyautogui.click(pyautogui.center(location)) sleep(5) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'16_submit.PNG'), confidence=0.8) print('code eror 16_submit') pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') continue except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'chek_tow_factor_1.PNG'), confidence=0.8) chek=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'one_trn.PNG'), confidence=0.8) chek=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'tow_factor__.PNG'), confidence=0.8) chek=True return True except: pass #tow_factor__.PNG if chek==True: return True else: return 'faill_all_code' except Exception as e: time.sleep(5) continue def handel_page_and_code_one_trn(self): for i in range(30): if self.dicline()=='Internal Server Error':return 'Internal Server Error' print(os.path.join(self.path_png_file,r'one_trn.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'one_trn.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek22=True return True except: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'one_trn.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') return True except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'tow_factor__.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') pyautogui.press('enter') pyautogui.press('enter') print('handel_page_and_code mission 3 next !!!!') chek22=True return True if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') return True break except Exception as e: time.sleep(5) continue return 'Two-factor authentication' def handel_page_and_codeapp_authentctor(self): for i in range(30): #if self.dicline()=='Internal Server Error':return 'Internal Server Error' print(os.path.join(self.path_png_file,r'17_app_authentctor.PNG')) try: location = pyautogui.locateOnScreen(os.path.join(path_png_file,r'app_authentctor__komaki.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') sleep(1) pyautogui.press('tab') sleep(1) pyautogui.press('right') sleep(1) pyautogui.press('tab') sleep(1) pyautogui.press('enter') sleep(15) try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'19_continue.PNG'), confidence=0.8) if location: print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'19_continue__.PNG'), confidence=0.8) if location: print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'18_send_code.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'18_send_code_1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'18_send_code_1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass #!!!!!!!!!!!!!!!!!! try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'19_continue.PNG'), confidence=0.8) if location: print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'19_continue__.PNG'), confidence=0.8) if location: print('handel_page_and_code mission 3 next !!!!') chek3=True return True except: pass #!!!!!!!!!!!!!!!!!! '''try: try: location = pyautogui.locateOnScreen(os.path.join(path_png_file,r'17_app_authentctor.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True break except: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'17_app_authentctor.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True break except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'17_3app_authentctor.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True break except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'17_2app_authentctor.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') chek3=True break except: pass''' except Exception as e: time.sleep(5) continue return '17_app_authentctor' def handel_page_and_code_19_continue(self): sleep(10) for i in range(30): # if self.dicline()=='Internal Server Error':return 'Internal Server Error' print(os.path.join(self.path_png_file,r'19_continue.PNG.PNG.PNG.PNG')) try: #try:#19_continue__.PNG # location = pyautogui.locateOnScreen(os.path.join(path_png_file,r'19_continue.PNG'), confidence=0.8) #if location: #pyautogui.click(pyautogui.center(location)) #print('handel_page_and_code mission 3 next !!!!') #chek5=True #eturn True #except: #pass try: location = pyautogui.locateOnScreen(os.path.join(path_png_file,r'19_continue__.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(path_png_file,r'su_contuinue.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) print('handel_page_and_code mission 3 next !!!!') return True except: pass except Exception as e: time.sleep(5) continue return '19_continue' def handel_page_and_code_komaki_write_code(self): tot=self.qr_code() self.tot=tot sleep(3) totx=self.top(tot) for i in range(30): #if self.dicline()=='Internal Server Error':return 'Internal Server Error' print(os.path.join(self.path_png_file,r'komaki.PNG.PNG.PNG.PNG.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'komaki__1.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') pyautogui.press('tab') pyautogui.press('tab') pyautogui.write(totx) pyautogui.press('tab') pyautogui.press('enter') print('handel_page_and_code mission 3 next !!!!') chek6=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'komaki.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') pyautogui.press('tab') pyautogui.press('tab') pyautogui.write(totx) pyautogui.press('tab') pyautogui.press('enter') print('handel_page_and_code mission 3 next !!!!') chek6=True return True except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'komaki.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') pyautogui.press('tab') pyautogui.press('tab') pyautogui.write(totx) pyautogui.press('tab') pyautogui.press('enter') print('handel_page_and_code mission 3 next !!!!') chek6=True return True except: pass except Exception as e: time.sleep(5) continue return 'input_bouten1' def handel_page_and_code_vew_back_up(self): for i in range(30): print(os.path.join(self.path_png_file,r'vew_back_up.PNG.PNG.PNG.PNG.PNG')) try: try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'ttttte.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) pyautogui.press('tab') sleep(1) pyautogui.press('tab') sleep(1) pyautogui.press('enter') sleep(5) return True except: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'vew_back_up.PNG'), confidence=0.8) if location: pyautogui.click(pyautogui.center(location)) return True except Exception as e: time.sleep(5) continue return 'vew_back_up' def handel_page_and_code(self,codex,value,val2): # 1 try: r = self.handel_page_and_code_send_code(codex,value,val2) except Exception as e: print(f"[ERROR] handel_page_and_code_send_code: {e}") return "handel_page_and_code_send_code", f"exception: {e}" # if r is not True: # print(f"[ERROR] handel_page_and_code_send_code: {r}") # return "handel_page_and_code_send_code", str(r) # time.sleep(10) # 2 try: r = self.handel_page_and_code_write_code(r) except Exception as e: print(f"[ERROR] handel_page_and_code_write_code: {e}") return "handel_page_and_code_write_code", f"exception: {e}" if r is not True: print(f"[ERROR] handel_page_and_code_write_code: {r}") return "handel_page_and_code_write_code", str(r) time.sleep(10) # 3 try: pyautogui.hotkey('ctrl', '-') except Exception as e: print(f"[ERROR] pyautogui ctrl- #1: {e}") return "pyautogui_ctrl_minus_1", f"exception: {e}" time.sleep(10) # 4 try: pyautogui.hotkey('ctrl', '-') except Exception as e: print(f"[ERROR] pyautogui ctrl- #2: {e}") return "pyautogui_ctrl_minus_2", f"exception: {e}" time.sleep(10) # 5 try: r = self.handel_page_and_code_one_trn() except Exception as e: print(f"[ERROR] handel_page_and_code_one_trn: {e}") return "handel_page_and_code_one_trn", f"exception: {e}" if r is not True: print(f"[ERROR] handel_page_and_code_one_trn: {r}") return "handel_page_and_code_one_trn", str(r) time.sleep(10) # 6 try: r = self.handel_page_and_codeapp_authentctor() except Exception as e: print(f"[ERROR] handel_page_and_codeapp_authentctor: {e}") return "handel_page_and_codeapp_authentctor", f"exception: {e}" if r is not True: print(f"[ERROR] handel_page_and_codeapp_authentctor: {r}") return "handel_page_and_codeapp_authentctor", str(r) time.sleep(10) # 7 try: r = self.handel_page_and_code_19_continue() except Exception as e: print(f"[ERROR] handel_page_and_code_19_continue: {e}") return "handel_page_and_code_19_continue", f"exception: {e}" if r is not True: print(f"[ERROR] handel_page_and_code_19_continue: {r}") return "handel_page_and_code_19_continue", str(r) time.sleep(10) # 8 try: r = self.handel_page_and_code_komaki_write_code() except Exception as e: print(f"[ERROR] handel_page_and_code_komaki_write_code: {e}") return "handel_page_and_code_komaki_write_code", f"exception: {e}" if r is not True: print(f"[ERROR] handel_page_and_code_komaki_write_code: {r}") return "handel_page_and_code_komaki_write_code", str(r) time.sleep(10) # 9 try: r = self.handel_page_and_code_vew_back_up() except Exception as e: print(f"[ERROR] handel_page_and_code_vew_back_up: {e}") return "handel_page_and_code_vew_back_up", f"exception: {e}" if r is not True: print(f"[ERROR] handel_page_and_code_vew_back_up: {r}") return "handel_page_and_code_vew_back_up", str(r) time.sleep(10) pyautogui.hotkey('ctrl', 'a') pyautogui.hotkey('ctrl', 'c') time.sleep(2) copied_text = pyperclip.paste() pattern = r'\d+\.\d+' codes = str(re.findall(pattern, copied_text)) #\d+\.\d+ try: return [self.tot,'$$',codes] except: return 'tot' def chek_by_pdb(self,name): time.sleep(5) return name def dicline(self): try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'fail_ant_try_again.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) print('Internal Server Error findddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd') return 'Internal Server Error' except: pass #fail_ant_try_again.PNG try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline_2.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline_2.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass ########################################### ########################################### try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline_3.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline_3_test.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass try: location = pyautogui.locateOnScreen(os.path.join(self.path_png_file,r'decline_3_1test.PNG'), confidence=0.8) pyautogui.click(pyautogui.center(location)) except: pass class Gmail: def __init__(self, name, password, browser_proxy=None): self.name = name self.password = password self.browser_proxy = browser_proxy self.flag='' self.flag_user='' self.flag_user_sg='' self.profile_dir = Path('profile') self.picher_dir = Path('picher') self.profile_dir.mkdir(exist_ok=True) self.picher_dir.mkdir(exist_ok=True) self.user_data_dir = self.profile_dir / self.name self.is_new_profile = not self.user_data_dir.exists() user_data_dir = os.path.join(os.getcwd(), 'profile', name) if name not in os.listdir(os.path.join(os.getcwd(), 'profile')): self.flag=True print(f"[INFO] No profile found for {self.name}. Browser will be visible.") else: print(f"[INFO] Profile found for {self.name}. Hiding browser window.") self.flag=False browser_args = [] #if not self.is_new_profile: # browser_args.append("--window-position=-32000,-32000") # print(f"[INFO] Profile found for {self.name}. Hiding browser window.") # self.flag=False # else: #print(f"[INFO] No profile found for {self.name}. Browser will be visible.") #self.flag=True self.ctx_manager = Camoufox( persistent_context=True, user_data_dir=str(self.user_data_dir), headless=False, geoip=False, enable_cache=True, humanize=True, # args=browser_args ) self.browser_context = self.ctx_manager.start() self.page = self.browser_context.new_page() if self.flag==True: user=self.send_username(name) if user==True: time.sleep(8) self.send_pasword(password) time.sleep(9) print('changelanggggggggggggggggggggggggg',self.change_lang()) else: self.flag_user=False self.flag_user_sg=user print(f"[INFO] Browser for {self.name} started.") def end(self): """این متد را برای بستن مرورگر فراخوانی کنید.""" if self.browser_context: self.browser_context.close() self.browser_context = None self.page = None self.ctx_manager = None print(f"[INFO] Browser context for {self.name} closed.") def check_cookies(self): """ این تابع فقط وضعیت لاگین را بررسی کرده و کوکیها را برمیگرداند. فرض بر این است که مراحل لاگین از قبل انجام شده است. """ try: # صبر میکنیم تا پس از لاگین، صفحه به مقصد برسد time.sleep(5) # به اینباکس میرویم تا ببینیم لاگین موفق بوده یا نه self.page.goto("https://mail.google.com/mail/u/0/#inbox", wait_until="domcontentloaded") if "mail.google.com/mail/u/0/" in self.page.url: print("[INFO] Login successful. Getting cookies.") return self._get_cookies_or_check_errors() # اگر به اینباکس نرفت، یعنی لاگین ناموفق بوده. خطاها را بررسی میکنیم. print("[INFO] Login failed. Checking for errors...") error = self._check_for_errors() if error: return error # اگر خطای مشخصی پیدا نشد، یک شکست عمومی را گزارش میدهیم self.page.screenshot(path=self.picher_dir / f"_{self.name}_login_failed.png") return 'fail_cookes' except Exception as e: print(f"[ERROR] An exception occurred in check_cookies: {e}") self.page.screenshot(path=self.picher_dir / f"_{self.name}_exception.png") return 'fail_cookes' def _get_cookies_or_check_errors(self): try: # تلاش برای رفتن به صفحه ورود (مثل کد اصلی) self.page.goto("https://accounts.google.com/v3/signin/", wait_until="load", timeout=10000) except Exception as e: # اگر خطای حلقه رخ داد، نادیده بگیر و ادامه بده print(f"[WARN] Redirect loop detected. Proceeding anyway. Error: {e}") pass # صبر میکنیم تا مطمئن شویم وضعیت پایدار است time.sleep(2) error = self._check_for_errors() if error: return error # در هر صورت، کوکیها را از محیط اصلی بگیرsameSite cookies = self.browser_context.cookies() keys_to_drop = {'sameSite', 'secure', 'httpOnly', 'expires'} cookies = [{k: v for k, v in c.items() if k not in keys_to_drop} for c in cookies] # شبیهسازی رفتار عجیب کد اصلی برای باز و بسته کردن تب self.page.goto("https://mail.google.com/mail/u/0/#inbox") new_page = self.browser_context.new_page() new_page.goto("https://www.google.com") time.sleep(2) new_page.close() print(cookies) # self.end() return json.dumps(cookies, indent=4, ensure_ascii=False) def _check_for_errors(self): """این تابع تمام بررسیهای خطای متنی و مبتنی بر عنصر کد اصلی را پوشش میدهد.""" page_content = self.page.content() if "Verify it" in page_content or "Confirm you’re not a robot" in page_content: self.page.screenshot(path=self.picher_dir / f"_{self.name}verify.png") return 'robot' if 'Wrong password. Try again' in page_content: self.page.screenshot(path=self.picher_dir / f"_{self.name}_pasword_eror.png") return 'pas_eror' if "Unable to access a Google product" in page_content: return 'block_acses' if 'To help keep your account secure' in page_content: return 'help keep your account secure' if 'Couldn’t find your Google Account' in page_content or 'find your Google Account' in page_content: return 'userx' try: self.page.locator('//*[@id="phoneNumberId"]').wait_for(state="visible", timeout=2000) print('find ************* phoneNumberId') return 'robot' except: pass return None def get_code(self): try: try: self.page.goto('https://mail.google.com/mail/u/0/#inbox', wait_until="domcontentloaded") except: pass time.sleep(35) try: self.page.reload(wait_until="domcontentloaded") except: pass time.sleep(35) minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") minimize_camoufox(title_hint="Camoufox") elements = self.page.locator("//*[contains(text(), 'Your EA Security Code is:')]") if elements.count() > 0: codes = [] for i in range(elements.count()): text = elements.nth(i).inner_text() data = text.replace('Your EA Security Code is: ', '') if data: print(data) codes.append(data.replace('EA','')) if codes: # print(codes) # return codes print("[INFO] Full text not found, trying regex...") elements = self.page.locator("//*[contains(text(), 'EA')]") codes = [] if elements.count() > 0: for i in range(elements.count()): text = elements.nth(i).inner_text() try: match = re.findall(r'EA (.+): (\d+)', text) if match: code = match[0][1] if code not in codes: print(codes) codes.append(code.replace('EA','')) except Exception: continue # print(codes) return codes if codes else 'continue' except Exception as e: print(f"[ERROR] Failed to get code: {e}") return 'continue' def send_username(self, user): try: # #import pdb;pdb.set_trace() self.page.goto("https://accounts.google.com/servicelogin?service=mail", wait_until="networkidle") time.sleep(1) email_input = self.page.locator("input[type='email'], input[type='text']").first email_input.wait_for(state="visible", timeout=15000) #if 'robot' in self.page.content(): # return 'robot' email_input.fill(user) try: self.page.locator("#identifierNext >> text=Next").click() except: self.page.locator("//*[contains(text(), 'Next')]").first.click() alert=self._check_for_errors() if alert==None: return True else: return alert except Exception as e: print(f"[ERROR] Could not send username: {e}") return 'Kill' def send_pasword(self, pasw): try: password_input = self.page.locator("input[name='Passwd']").first # password_input.wait_for(state="visible", timeout=10000) #if 'robot' in self.page.content(): #return 'robot' password_input.fill(pasw) try: self.page.locator("#passwordNext >> text=Next").click() except: self.page.locator("//*[contains(text(), 'Next')]").first.click() return True except Exception as e: print(f"[ERROR] Could not send password: {e}") return 'Kill' def change_lang(self): try: self.page.goto("https://mail.google.com/mail/u/0/#settings/general") time.sleep(10) lang_select = self.page.get_by_role("cell", name="Gmail display language:").get_by_role("combobox") lang_select.select_option(label="English (US)") try: self.page.get_by_role("button", name="Save Changes").click() except: pass time.sleep(3) #self.page.goto("https://myaccount.google.com/language") self.page.goto("https://myaccount.google.com/language", wait_until="domcontentloaded") time.sleep(5) for i in range(8): try: try: sfg = self.page.locator("xpath=//div/button/div") sfg.click() xd = True break except: pass try: try: sfg = self.page.locator("xpath=/html/body/c-wiz/div/div[2]/div[2]/c-wiz/div[1]/div[4]/div/div[1]/ul/li/div/div[2]/div/button/div") sfg.click() xd = True break except: sfg = self.page.locator("xpath=/html/body/c-wiz/div/div[2]/div[2]/c-wiz/div[1]/div[4]/div/div[1]/ul/li/div/div[2]/div/span/button/div") sfg.click() xd = True break xd = True break except: pass # try: # self.page.locator('html').click() # self.page.locator('html').press('Tab') # active_element = self.page.locator(":focus") ## active_element.click() # xd = True # break # except: # pass except: self.page.reload() time.sleep(5) # فقط روی دکمه "Edit" تمرکز میکنیم و برایش صبر میکنیم time.sleep(2) # بقیه منطق شما که شکننده است ولی حفظ شده try: search_input = self.page.locator("input[aria-label*='Search']").first search_input.fill("English") search_input.press("ArrowDown") search_input.press("Enter") except: active_element = self.page.locator(":focus") active_element.fill("English") active_element.press("ArrowDown") active_element.press("Enter") time.sleep(1) self.page.locator("//li[58]").first.click() self.page.locator("xpath=//div[3]/button/span[5]").click() return True except Exception as e: print(f"[ERROR] Could not change language: {e}") # برای دیباگ کردن، یک اسکرینشات بگیر self.page.screenshot(path=self.picher_dir / f"_{self.name}_lang_error.png") return False def status(self): try: self.page.goto('https://mail.google.com/mail/u/0/#inbox', wait_until="networkidle") time.sleep(5) if "mail.google.com/mail/u/0/#inbox" in self.page.url: self.change_lang() return True return False except Exception as e: print(f"[ERROR] Status check failed: {e}") return False def main(path_png_file, chrome, eamil, get_cookes, codex, value, val2, browser_proxy, ): ea=ea_fucking(path_png_file) load_browser_windows=ea.load_browser_windows(chrome) # pyautogui.press("enter") ea.get_tor() pyautogui.press("enter") sleep(1) get_ea=ea.get_to_ea() print('get_to_ea >>>',get_ea) if 'ea_created__app_code_nead!!' in str(get_ea): return 'ea_created__app_code_nead!!' if get_ea: print('get_to_ea ok hoeraaa gooo') clik_extenshen = ea.clik_extenshen(get_cookes=get_cookes) print('clik_extenshen >>>', clik_extenshen) if isinstance(clik_extenshen, str):return clik_extenshen if clik_extenshen: # Click month click_gmail = ea.click_gmail() print('click_gmail >>>', click_gmail) if isinstance(click_gmail, str):return click_gmail if not click_gmail: print('click_gmail Failed!') return 'click_gmail Failed' # Click day sleep(15) chek_logo = ea.chek_logo() print('chek_logo >>>', chek_logo) #if isinstance(chek_logo, str):return chek_logo send_green_status(server) if chek_logo=='fail_mail': return 'fail_mail' if chek_logo==True: continue_page = ea.continue_page() print('continue_page >>>', continue_page) if not continue_page: print('continue_page Failed!') return 'continue_page Failed' ##################################################################################################################################### if continue_page=='nime': sleep(10) #######################################$$$$$ get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' print('----------//////////',get_turn_on_2) ##import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) send_green_status(server) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ # Go to next page input_PATRH = ea.input_PATRH() if isinstance(input_PATRH, str):return input_PATRH print('input_PATRH >>>', input_PATRH) if not input_PATRH: print('input_PATRH Failed!') return 'input_PATRH Failed' # Check CAPTCHA contuen_page2 = ea.contuen_page2() if isinstance(contuen_page2, str):return contuen_page2 print('contuen_page2 >>>', contuen_page2) if not contuen_page2: print('contuen_page2 Failed!') return 'contuen_page2 Failed' # #import pdb;pdb.set_trace() # Accept buttons next = ea.next() if isinstance(next, str):return next print('next >>>', next) if not next: print('next Failed!') return 'next Failed' ############################################################## sleep(10) accept = ea.accept() print('accept >>>', accept) if 'make_other_time'==accept: ##import pdb;pdb.set_trace() #return 'make_other_time' sleep(10) get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' print('----------//////////',get_turn_on_2) ##import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code if not accept: print('accept Failed!') return 'accept Failed' send_green_status(server) # Click verify sleep(10) creat = ea.creat() if 'make_other_time'==creat: #return 'make_other_time' sleep(10) get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' ##import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code print('creat >>>', creat) if isinstance(creat, str):return creat if not creat: print('creat Failed!') return 'creat Failed' sleep(10) finsh = ea.finsh() if isinstance(finsh, str):return finsh print('finsh >>>', finsh) if not finsh: print('finsh Failed!') return 'finsh Failed' #######################################$$$$$ get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' # #import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('get_send_sec_3 >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) send_green_status(server) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ # import #pdb;pdb.set_trace() return handel_page_and_code send_green_status(server) if chek_logo=='nime': send_green_status(server) next = ea.next() if isinstance(next, str):return next print('next >>>', next) if not next: print('next Failed!') return 'next Failed' ########################################################## sleep(10) accept = ea.accept() print('accept >>>', accept) if 'make_other_time'==accept: ##import pdb;pdb.set_trace() #return 'make_other_time' ##import pdb;pdb.set_trace() #return 'make_other_time' sleep(10) get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' print('----------//////////',get_turn_on_2) ##import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) send_green_status(server) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code if not accept: print('accept Failed!') return 'accept Failed' # Click verify sleep(10) creat = ea.creat() if 'make_other_time'==creat: #return 'make_other_time' sleep(10) get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' ##import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code print('creat >>>', creat) if not creat: print('creat Failed!') return 'creat Failed' sleep(10) finsh = ea.finsh() if isinstance(finsh, str):return finsh print('finsh >>>', finsh) if not finsh: print('finsh Failed!') return 'finsh Failed' #######################################$$$$$ get_seting_sec_1 = ea.get_seting_sec_1() if isinstance(get_seting_sec_1, str):return get_seting_sec_1 print('ea.get_seting_sec_1 >>>', get_seting_sec_1) if not ea.get_seting_sec_1: print('ea.get_seting_sec_1 Failed!') return 'ea.get_seting_sec_1 Failed' sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' print('----------//////////',get_turn_on_2) # #import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) send_green_status(server) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code # Open new tab send_green_status(server) if chek_logo=='jump_to_sec': send_green_status(server) sleep(10) get_turn_on_2 = ea.get_turn_on_2(codex,value,val2) if 'ALERT_to_mnay_code_chek' in str(get_turn_on_2): return 'ALERT_to_mnay_code_chek' print('----------//////////',get_turn_on_2) ##import pdb;pdb.set_trace() if 'ea_created__app_code_nead!!' in str(get_turn_on_2): return "ea_created__app_code_nead!!" if isinstance(get_turn_on_2, str):return get_turn_on_2 print('ea.get_turn_on_2 >>>', get_turn_on_2) if not get_turn_on_2: print('ea.get_turn_on_2 Failed!') return 'ea.get_turn_on_2 Failed' sleep(10) send_green_status(server) get_send_sec_3 = ea.get_send_sec_3() if isinstance(get_send_sec_3, str):return get_send_sec_3 print('finsh >>>', get_send_sec_3) if not get_send_sec_3: print('ea.get_send_sec_3 Failed!') return 'ea.get_send_sec_3 Failed' sleep(10) #import pdb;pdb.set_trace() handel_page_and_code = ea.handel_page_and_code(codex,value,val2) #import pdb;pdb.set_trace() if 'ALERT_to_mnay_code_chek' in handel_page_and_code: return 'ALERT_to_mnay_code_chek' if isinstance(handel_page_and_code, str):return handel_page_and_code print('handel_page_and_code >>>', handel_page_and_code) if not handel_page_and_code: print('handel_page_and_code Failed!') return 'handel_page_and_code Failed' ###########################################^^^^ ##import pdb;pdb.set_trace() return handel_page_and_code ###################################### send_green_status(server) if 'click_gmail' in str(get_ea): send_green_status(server) return 'get_ea Failed___1' else: send_green_status(server) print('get_ea Failed!') return 'get_ea Failed___2' ######################################################################### def create_session(name,pas): BASE_URL=os.getenv("url") response = requests.post(f"{BASE_URL}/create_session", json={"name": name,"pas":pas},timeout=500) if '