bcpkgfox 0.17.6__py3-none-any.whl → 0.17.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bcpkgfox/invoke_api.py +45 -8
- {bcpkgfox-0.17.6.dist-info → bcpkgfox-0.17.8.dist-info}/METADATA +1 -1
- {bcpkgfox-0.17.6.dist-info → bcpkgfox-0.17.8.dist-info}/RECORD +6 -6
- {bcpkgfox-0.17.6.dist-info → bcpkgfox-0.17.8.dist-info}/WHEEL +0 -0
- {bcpkgfox-0.17.6.dist-info → bcpkgfox-0.17.8.dist-info}/entry_points.txt +0 -0
- {bcpkgfox-0.17.6.dist-info → bcpkgfox-0.17.8.dist-info}/top_level.txt +0 -0
bcpkgfox/invoke_api.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
1
3
|
from selenium.webdriver.support import expected_conditions as EC
|
|
2
4
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
3
5
|
from selenium.webdriver.common.by import By
|
|
@@ -320,19 +322,32 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
320
322
|
|
|
321
323
|
self.driver.get("https://chromewebstore.google.com/detail/whom-gerenciador-de-certi/lnidijeaekolpfeckelhkomndglcglhh")
|
|
322
324
|
|
|
323
|
-
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
|
|
324
|
-
time.sleep(5)
|
|
325
325
|
|
|
326
|
-
|
|
327
|
-
pyautogui.press('tab')
|
|
328
|
-
time.sleep(0.5)
|
|
329
|
-
pyautogui.press('enter')
|
|
326
|
+
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
|
|
330
327
|
time.sleep(5)
|
|
328
|
+
import pygetwindow as gw
|
|
329
|
+
windows = gw.getAllTitles()
|
|
330
|
+
for w in windows:
|
|
331
|
+
if w and "Whom?".lower() in w.lower():
|
|
332
|
+
print("Janela de extensão detectada:", w)
|
|
333
|
+
window = gw.getWindowsWithTitle(w)[0]
|
|
334
|
+
window.activate()
|
|
335
|
+
time.sleep(1)
|
|
336
|
+
coords = (gw.getActiveWindow().left + gw.getActiveWindow().size[0] // 2,
|
|
337
|
+
gw.getActiveWindow().top + int(gw.getActiveWindow().size[1] * 0.3))
|
|
338
|
+
pyautogui.moveTo(coords[0], coords[1])
|
|
339
|
+
pyautogui.click()
|
|
340
|
+
|
|
341
|
+
# Envia TAB e ENTER do teclado físico
|
|
342
|
+
pyautogui.press('tab')
|
|
343
|
+
time.sleep(0.5)
|
|
344
|
+
pyautogui.press('enter')
|
|
345
|
+
time.sleep(5)
|
|
346
|
+
break
|
|
331
347
|
|
|
332
348
|
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
333
349
|
|
|
334
350
|
def codes_2_fac(self):
|
|
335
|
-
|
|
336
351
|
try:
|
|
337
352
|
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=2).send_keys(self.system)
|
|
338
353
|
code_insertion = True
|
|
@@ -422,7 +437,18 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
422
437
|
if not(code_insertion):
|
|
423
438
|
raise TimeoutError('Código WHOOM não chegou dentro do timeout estabelecido')
|
|
424
439
|
|
|
440
|
+
def select_system(self):
|
|
425
441
|
time.sleep(4)
|
|
442
|
+
try:
|
|
443
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]',
|
|
444
|
+
timeout=1).click()
|
|
445
|
+
time.sleep(1)
|
|
446
|
+
self.codes_2_fac()
|
|
447
|
+
self.select_system()
|
|
448
|
+
return
|
|
449
|
+
except:
|
|
450
|
+
pass
|
|
451
|
+
|
|
426
452
|
# Selects the system to access
|
|
427
453
|
lines = tools.find_elements_with_wait(By.XPATH, '//div[@role="menu"]//div[@role="menuitem"]')
|
|
428
454
|
|
|
@@ -470,6 +496,16 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
470
496
|
mostrar_mensagem('Mais de um sistema encontrado, verifique o nome do sistema no WHOOM e coloque um nome único na função')
|
|
471
497
|
raise ValueError('Mais de um sistema encontrado, verifique o nome')
|
|
472
498
|
|
|
499
|
+
try:
|
|
500
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]',
|
|
501
|
+
timeout=1).click()
|
|
502
|
+
time.sleep(1)
|
|
503
|
+
self.codes_2_fac()
|
|
504
|
+
self.select_system()
|
|
505
|
+
return
|
|
506
|
+
except:
|
|
507
|
+
pass
|
|
508
|
+
|
|
473
509
|
# Verifies if the system was opened
|
|
474
510
|
for _ in range(30):
|
|
475
511
|
time.sleep(1)
|
|
@@ -508,4 +544,5 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
508
544
|
# Operacional
|
|
509
545
|
bot.extension_check()
|
|
510
546
|
protection.start()
|
|
511
|
-
bot.codes_2_fac()
|
|
547
|
+
bot.codes_2_fac()
|
|
548
|
+
bot.select_system()
|
|
@@ -3,10 +3,10 @@ bcpkgfox/clean.py,sha256=80pJDTGmKmPiq73uL1IWopuxqVJF_bj_RVv-njkpl-A,8946
|
|
|
3
3
|
bcpkgfox/cli.py,sha256=E1Yahd8jIjUwxM6EMHveDDne5-fh8QeAvAhyATNatEo,33541
|
|
4
4
|
bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,23027
|
|
5
5
|
bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
|
|
6
|
-
bcpkgfox/invoke_api.py,sha256
|
|
6
|
+
bcpkgfox/invoke_api.py,sha256=qvxmNGkaHmse2P9PPdZUia6KrDu5ly-2m83mUh3ENGI,20540
|
|
7
7
|
bcpkgfox/system.py,sha256=3lyOWx893T6KiAI-jDv7zAo3oKPf0Q5CLgZ8TeFd0Do,7901
|
|
8
|
-
bcpkgfox-0.17.
|
|
9
|
-
bcpkgfox-0.17.
|
|
10
|
-
bcpkgfox-0.17.
|
|
11
|
-
bcpkgfox-0.17.
|
|
12
|
-
bcpkgfox-0.17.
|
|
8
|
+
bcpkgfox-0.17.8.dist-info/METADATA,sha256=puzPjakadkhishgfZyxU-d0jQMwglnoIDfr4Q5tsdpU,1893
|
|
9
|
+
bcpkgfox-0.17.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
bcpkgfox-0.17.8.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
|
|
11
|
+
bcpkgfox-0.17.8.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
|
|
12
|
+
bcpkgfox-0.17.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|