Skip to content

Commit

Permalink
Update to v1.5.2.1
Browse files Browse the repository at this point in the history
1. Changing the algorithms for --key, --small-business-key
  • Loading branch information
rzc0d3r authored Oct 14, 2024
1 parent 341a010 commit 9c6bfa1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Binary file modified img/project_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from modules.EmailAPIs import *

# ---- Quick settings [for Developers to quickly change behavior without changing all files] ----
VERSION = ['v1.5.2.0', 1520]
VERSION = ['v1.5.2.1', 1521]
LOGO = f"""
███████╗███████╗███████╗████████╗ ██╗ ██╗███████╗██╗ ██╗ ██████╗ ███████╗███╗ ██╗
██╔════╝██╔════╝██╔════╝╚══██╔══╝ ██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔════╝████╗ ██║
Expand Down
22 changes: 18 additions & 4 deletions modules/EsetTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, registered_email_obj: OneSecEmailAPI, driver: Chrome, mode='E
def sendRequestForKey(self):
exec_js = self.driver.execute_script
uCE = untilConditionExecute

console_log(f'\n[{self.mode}] Request sending...', INFO)
self.driver.get('https://home.eset.com/subscriptions/choose-trial')
uCE(self.driver, f"return {GET_EBAV}('button', 'data-label', 'subscription-choose-trial-ehsp-card-button') != null")
Expand All @@ -99,9 +99,20 @@ def sendRequestForKey(self):
elif self.mode == 'SMALL BUSINESS':
uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('button', 'data-label', 'subscription-choose-trial-esbs-card-button'))")
try:
exec_js(f'{GET_EBCN}("css-17v7x12")[0].click()')
for button in self.driver.find_elements('tag name', 'button'):
if button.get_attribute('innerText').strip().lower() == 'continue':
exec_js(f'{GET_EBCN}("{button.get_attribute("class")}")[0].click()')
break
else:
raise RuntimeError('Continue button error!')
uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('button', 'data-label', 'subscription-choose-trial-esbs-card-button'))")
exec_js(f'{GET_EBCN}("css-17v7x12")[0].click()')
time.sleep(1)
for button in self.driver.find_elements('tag name', 'button'):
if button.get_attribute('innerText').strip().lower() == 'continue':
exec_js(f'{GET_EBCN}("{button.get_attribute("class")}")[0].click()')
break
else:
raise RuntimeError('Continue button error!')
console_log(f'[{self.mode}] Request successfully sent!', OK)
except:
raise RuntimeError('Request sending error!!!')
Expand All @@ -110,9 +121,12 @@ def getLicenseData(self):
exec_js = self.driver.execute_script
uCE = untilConditionExecute
console_log('\nLicense uploads...', INFO)
uCE(self.driver, f"return typeof {GET_EBAV}('div', 'class', 'LicenseDetailInfo') === 'object'")
uCE(self.driver, f"return {GET_EBAV}('div', 'class', 'LicenseDetailInfo') != null")
if self.driver.current_url.find('detail') != -1:
console_log(f'License ID: {self.driver.current_url[-11:]}', OK)
uCE(self.driver, f"return {GET_EBAV}('div', 'data-r', 'license-detail-product-name') != null", max_iter=10)
uCE(self.driver, f"return {GET_EBAV}('div', 'data-r', 'license-detail-license-model-additional-info') != null", max_iter=10)
uCE(self.driver, f"return {GET_EBAV}('div', 'data-r', 'license-detail-license-key') != null", max_iter=10)
license_name = exec_js(f"return {GET_EBAV}('div', 'data-r', 'license-detail-product-name').innerText")
license_out_date = exec_js(f"return {GET_EBAV}('div', 'data-r', 'license-detail-license-model-additional-info').innerText")
license_key = exec_js(f"return {GET_EBAV}('div', 'data-r', 'license-detail-license-key').innerText")
Expand Down

0 comments on commit 9c6bfa1

Please sign in to comment.