bcpkgfox 0.17.1__py3-none-any.whl → 0.17.3__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.
Potentially problematic release.
This version of bcpkgfox might be problematic. Click here for more details.
- bcpkgfox/invoke_api.py +15 -9
- {bcpkgfox-0.17.1.dist-info → bcpkgfox-0.17.3.dist-info}/METADATA +1 -1
- {bcpkgfox-0.17.1.dist-info → bcpkgfox-0.17.3.dist-info}/RECORD +6 -6
- {bcpkgfox-0.17.1.dist-info → bcpkgfox-0.17.3.dist-info}/WHEEL +0 -0
- {bcpkgfox-0.17.1.dist-info → bcpkgfox-0.17.3.dist-info}/entry_points.txt +0 -0
- {bcpkgfox-0.17.1.dist-info → bcpkgfox-0.17.3.dist-info}/top_level.txt +0 -0
bcpkgfox/invoke_api.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
from selenium.webdriver.support import expected_conditions as EC
|
|
2
|
+
from selenium.webdriver.support.ui import WebDriverWait
|
|
3
|
+
from selenium.webdriver.common.by import By
|
|
1
4
|
from typing import Optional
|
|
2
5
|
from threading import Thread
|
|
3
6
|
import time
|
|
7
|
+
import os
|
|
4
8
|
|
|
5
9
|
def invoke_api_list(link: str, token: str, method: Optional[str] = "GET", headers: Optional[str] = None, print_response: Optional[bool] = False) -> dict:
|
|
6
10
|
import requests
|
|
@@ -164,6 +168,9 @@ def invoke_api_proc_log(link, id_robo, token):
|
|
|
164
168
|
print(f"\n{responseinsert.json()}")
|
|
165
169
|
|
|
166
170
|
def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
171
|
+
import requests
|
|
172
|
+
import pyautogui
|
|
173
|
+
from . import mostrar_mensagem
|
|
167
174
|
|
|
168
175
|
class login_2fac:
|
|
169
176
|
def __init__(self):
|
|
@@ -462,30 +469,29 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
462
469
|
raise ValueError('Mais de um sistema encontrado, verifique o nome')
|
|
463
470
|
|
|
464
471
|
# Verifies if the system was opened
|
|
465
|
-
|
|
466
|
-
for _ in range(5):
|
|
472
|
+
for _ in range(30):
|
|
467
473
|
time.sleep(1)
|
|
468
|
-
if len(self.driver.window_handles) ==
|
|
474
|
+
if len(self.driver.window_handles) == 1:
|
|
469
475
|
try:
|
|
470
476
|
tools.find_element_with_wait(By.XPATH, "//button[text()='Acessar']", timeout=1).click()
|
|
471
477
|
except:
|
|
472
|
-
|
|
478
|
+
time.sleep(1)
|
|
473
479
|
else:
|
|
480
|
+
time.sleep(3)
|
|
474
481
|
break
|
|
475
482
|
|
|
476
|
-
|
|
477
|
-
self.driver.switch_to.window(handles[-1])
|
|
478
|
-
protection.stop()
|
|
479
|
-
|
|
483
|
+
self.driver.switch_to.window(self.driver.window_handles[-1])
|
|
480
484
|
attempt = 0
|
|
481
485
|
while 'whoom' in self.driver.title.strip().lower() and attempt <= 180:
|
|
482
486
|
time.sleep(1)
|
|
483
487
|
attempt += 1
|
|
488
|
+
time.sleep(5)
|
|
484
489
|
|
|
485
490
|
if attempt >= 180:
|
|
486
491
|
mostrar_mensagem('Whoom congelou no conectar com site.')
|
|
487
492
|
raise SystemError('Whoom congelou no conectar com site.')
|
|
488
493
|
|
|
494
|
+
protection.stop()
|
|
489
495
|
if len(self.driver.window_handles) > 1:
|
|
490
496
|
self.driver.switch_to.window(self.driver.window_handles[0])
|
|
491
497
|
self.driver.close()
|
|
@@ -500,4 +506,4 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
500
506
|
# Operacional
|
|
501
507
|
bot.extension_check()
|
|
502
508
|
protection.start()
|
|
503
|
-
bot.codes_2_fac()
|
|
509
|
+
bot.codes_2_fac()
|
|
@@ -6,10 +6,10 @@ bcpkgfox/examples.py,sha256=gNKQBlONca0W81QHwUlnv_-J135dEj9IwBhCpmohMYw,5486
|
|
|
6
6
|
bcpkgfox/exec_file.py,sha256=fl_Do2SlF7JuXazpNTod-e_0WZUk355fbd7ustQvi40,3728
|
|
7
7
|
bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,23027
|
|
8
8
|
bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
|
|
9
|
-
bcpkgfox/invoke_api.py,sha256=
|
|
9
|
+
bcpkgfox/invoke_api.py,sha256=OjJhqgrFRpvVBJf05AvkDOdwxVItZ_lily5Ja_V1Z18,18938
|
|
10
10
|
bcpkgfox/system.py,sha256=3lyOWx893T6KiAI-jDv7zAo3oKPf0Q5CLgZ8TeFd0Do,7901
|
|
11
|
-
bcpkgfox-0.17.
|
|
12
|
-
bcpkgfox-0.17.
|
|
13
|
-
bcpkgfox-0.17.
|
|
14
|
-
bcpkgfox-0.17.
|
|
15
|
-
bcpkgfox-0.17.
|
|
11
|
+
bcpkgfox-0.17.3.dist-info/METADATA,sha256=Fm7TFjAKvHKmCrffAMGMc5XuhG07VoOopf8hqEV42nM,1911
|
|
12
|
+
bcpkgfox-0.17.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
13
|
+
bcpkgfox-0.17.3.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
|
|
14
|
+
bcpkgfox-0.17.3.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
|
|
15
|
+
bcpkgfox-0.17.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|