bcpkgfox 0.17.2__py3-none-any.whl → 0.17.4__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 +14 -19
- {bcpkgfox-0.17.2.dist-info → bcpkgfox-0.17.4.dist-info}/METADATA +1 -1
- {bcpkgfox-0.17.2.dist-info → bcpkgfox-0.17.4.dist-info}/RECORD +6 -6
- {bcpkgfox-0.17.2.dist-info → bcpkgfox-0.17.4.dist-info}/WHEEL +1 -1
- {bcpkgfox-0.17.2.dist-info → bcpkgfox-0.17.4.dist-info}/entry_points.txt +0 -0
- {bcpkgfox-0.17.2.dist-info → bcpkgfox-0.17.4.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,18 +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):
|
|
167
|
-
|
|
168
|
-
from . import mostrar_mensagem
|
|
169
|
-
import bcpkgfox as bc
|
|
170
171
|
import requests
|
|
171
|
-
import time
|
|
172
172
|
import pyautogui
|
|
173
|
-
import
|
|
174
|
-
|
|
175
|
-
from threading import Thread
|
|
176
|
-
from selenium.webdriver.common.by import By
|
|
177
|
-
from selenium.webdriver.support.ui import WebDriverWait
|
|
178
|
-
from selenium.webdriver.support import expected_conditions as EC
|
|
173
|
+
from . import mostrar_mensagem
|
|
179
174
|
|
|
180
175
|
class login_2fac:
|
|
181
176
|
def __init__(self):
|
|
@@ -458,6 +453,7 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
458
453
|
raise ValueError('Não conseguiu achar o sistema no certificado')
|
|
459
454
|
|
|
460
455
|
if len(div_list) == 1:
|
|
456
|
+
time.sleep(1)
|
|
461
457
|
div_list[0].click()
|
|
462
458
|
|
|
463
459
|
# Just do this loop if there are more than one system
|
|
@@ -474,30 +470,29 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
474
470
|
raise ValueError('Mais de um sistema encontrado, verifique o nome')
|
|
475
471
|
|
|
476
472
|
# Verifies if the system was opened
|
|
477
|
-
|
|
478
|
-
for _ in range(5):
|
|
473
|
+
for _ in range(30):
|
|
479
474
|
time.sleep(1)
|
|
480
|
-
if len(self.driver.window_handles) ==
|
|
475
|
+
if len(self.driver.window_handles) == 1:
|
|
481
476
|
try:
|
|
482
477
|
tools.find_element_with_wait(By.XPATH, "//button[text()='Acessar']", timeout=1).click()
|
|
483
478
|
except:
|
|
484
|
-
|
|
479
|
+
time.sleep(1)
|
|
485
480
|
else:
|
|
481
|
+
time.sleep(3)
|
|
486
482
|
break
|
|
487
483
|
|
|
488
|
-
|
|
489
|
-
self.driver.switch_to.window(handles[-1])
|
|
490
|
-
protection.stop()
|
|
491
|
-
|
|
484
|
+
self.driver.switch_to.window(self.driver.window_handles[-1])
|
|
492
485
|
attempt = 0
|
|
493
486
|
while 'whoom' in self.driver.title.strip().lower() and attempt <= 180:
|
|
494
487
|
time.sleep(1)
|
|
495
488
|
attempt += 1
|
|
489
|
+
time.sleep(5)
|
|
496
490
|
|
|
497
491
|
if attempt >= 180:
|
|
498
492
|
mostrar_mensagem('Whoom congelou no conectar com site.')
|
|
499
493
|
raise SystemError('Whoom congelou no conectar com site.')
|
|
500
494
|
|
|
495
|
+
protection.stop()
|
|
501
496
|
if len(self.driver.window_handles) > 1:
|
|
502
497
|
self.driver.switch_to.window(self.driver.window_handles[0])
|
|
503
498
|
self.driver.close()
|
|
@@ -512,4 +507,4 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
512
507
|
# Operacional
|
|
513
508
|
bot.extension_check()
|
|
514
509
|
protection.start()
|
|
515
|
-
bot.codes_2_fac()
|
|
510
|
+
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=GTokMMeHkQH-fMLnCY_GoEc-48bk3GtLZgZQSuNonSs,18969
|
|
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.4.dist-info/METADATA,sha256=mvHFmIOXkbUGOBvKsAOpvVKvf6RmQTtjdLyljIGH53E,1911
|
|
12
|
+
bcpkgfox-0.17.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
bcpkgfox-0.17.4.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
|
|
14
|
+
bcpkgfox-0.17.4.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
|
|
15
|
+
bcpkgfox-0.17.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|