Skip to content

Commit

Permalink
Update to v1.0.9.3 (221123-0959)
Browse files Browse the repository at this point in the history
1. Cookie bypass added
2. Added algorithm execution check (Now the algorithm will not be executed if any part of it has not been executed)
  • Loading branch information
rzc0d3r authored Nov 22, 2023
1 parent a39a3dd commit 47d4a7a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def chrome_driver_installer_menu(): # auto updating or installing chrome driver
email_obj = sec_email_api.SecEmail()
logger.console_log('Mail registration...', logger.INFO)
email_obj.register()
logger.console_log('Mail registration completed successfully!\n', logger.OK)
logger.console_log('Mail registration completed successfully!', logger.OK)
eset_password = shared_tools.createPassword(6)
EsetReg = eset_register.EsetRegister(email_obj, eset_password, driver)
EsetReg.createAccount()
Expand Down
12 changes: 10 additions & 2 deletions modules/eset_register.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v1.0.9.2 (211123-1059)
VERSION = 'v1.0.9.2 (211123-1059) by rzc0d3r'
# v1.0.9.3 (221123-0959)
VERSION = 'v1.0.9.3 (221123-0959) by rzc0d3r'

from modules.logger import *
from modules.shared_tools import *
Expand Down Expand Up @@ -38,6 +38,14 @@ def createAccount(self):
console_log('\n[EMAIL] Register page loading...', INFO)
self.driver.get('https://login.eset.com/Register')
console_log('[EMAIL] Register page is loaded!', OK)

console_log('\nBypassing cookies...', INFO)
if uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('button', 'id', 'cc-accept'))", max_iter=10, raise_exception_if_failed=False):
console_log('Cookies successfully bypassed!', OK)
time.sleep(1.5) # Once pressed, you have to wait a little while. If code do not do this, the site does not count the acceptance of cookies
else:
console_log("Cookies were not bypassed (it doesn't affect the algorithm, I think :D)", ERROR)

exec_js(f"{GET_EBID}('Email').value='{self.email_obj.get_full_login()}'")
exec_js('document.forms[0].submit()')

Expand Down
7 changes: 4 additions & 3 deletions modules/shared_tools.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# v1.0.2 (211123-1059)
# v1.0.3 (221123-0959)
from selenium.webdriver import Chrome, ChromeOptions, ChromeService
from selenium.webdriver import Firefox, FirefoxOptions, FirefoxService

from modules.logger import *

import subprocess
import time
import random
import string
Expand Down Expand Up @@ -41,7 +40,7 @@
DEFAULT_MAX_ITER = 30
DEFAULT_DELAY = 1

def untilConditionExecute(chrome_driver_obj: Chrome, js: str, delay=DEFAULT_DELAY, max_iter=DEFAULT_MAX_ITER, positive_result=True):
def untilConditionExecute(chrome_driver_obj: Chrome, js: str, delay=DEFAULT_DELAY, max_iter=DEFAULT_MAX_ITER, positive_result=True, raise_exception_if_failed=True):
chrome_driver_obj.execute_script(f'window.{GET_EBAV} = {DEFINE_GET_EBAV_FUNCTION}')
chrome_driver_obj.execute_script(f'window.{CLICK_WITH_BOOL} = {DEFINE_CLICK_WITH_BOOL_FUNCTION}')
pre_js = [
Expand All @@ -57,6 +56,8 @@ def untilConditionExecute(chrome_driver_obj: Chrome, js: str, delay=DEFAULT_DELA
except Exception as E:
pass
time.sleep(delay)
if raise_exception_if_failed:
raise RuntimeError('untilConditionExecute: the code did not return the desired value!')

def createPassword(length):
return ''.join(['Xx0$']+[random.choice(string.ascii_letters) for _ in range(length)])
Expand Down

0 comments on commit 47d4a7a

Please sign in to comment.