bcpkgfox 0.16.70__py3-none-any.whl → 0.16.72__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/cli.py +1 -0
- bcpkgfox/invoke_api.py +81 -52
- {bcpkgfox-0.16.70.dist-info → bcpkgfox-0.16.72.dist-info}/METADATA +1 -1
- {bcpkgfox-0.16.70.dist-info → bcpkgfox-0.16.72.dist-info}/RECORD +7 -7
- {bcpkgfox-0.16.70.dist-info → bcpkgfox-0.16.72.dist-info}/WHEEL +0 -0
- {bcpkgfox-0.16.70.dist-info → bcpkgfox-0.16.72.dist-info}/entry_points.txt +0 -0
- {bcpkgfox-0.16.70.dist-info → bcpkgfox-0.16.72.dist-info}/top_level.txt +0 -0
bcpkgfox/cli.py
CHANGED
|
@@ -544,6 +544,7 @@ class cli:
|
|
|
544
544
|
"PdfWriter": "pypdf",
|
|
545
545
|
"import PyPDF2": "PyPDF2",
|
|
546
546
|
"invoke_api_": "requests",
|
|
547
|
+
"login_2fac": "pyautogui",
|
|
547
548
|
"wait_for": "pygetwindow",
|
|
548
549
|
"from selenium_stealth import stealth": "selenium-stealth",
|
|
549
550
|
"capmonstercloudclient": "bcpkgfox[capmonstercloudclient]",
|
bcpkgfox/invoke_api.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
|
+
from threading import Thread
|
|
2
3
|
import time
|
|
3
4
|
|
|
4
5
|
def invoke_api_list(link: str, token: str, method: Optional[str] = "GET", headers: Optional[str] = None, print_response: Optional[bool] = False) -> dict:
|
|
@@ -179,6 +180,30 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
179
180
|
self.code_timeout = code_timeout
|
|
180
181
|
self.driver = driver
|
|
181
182
|
|
|
183
|
+
class Pop_up_protection(login_2fac):
|
|
184
|
+
def __init__(self):
|
|
185
|
+
super().__init__()
|
|
186
|
+
self.status = False
|
|
187
|
+
|
|
188
|
+
def __monitor(self):
|
|
189
|
+
while self.status:
|
|
190
|
+
for handle in self.driver.window_handles:
|
|
191
|
+
try:
|
|
192
|
+
self.driver.switch_to.window(handle)
|
|
193
|
+
alert = self.driver.switch_to.alert
|
|
194
|
+
alert.accept()
|
|
195
|
+
except:
|
|
196
|
+
pass
|
|
197
|
+
time.sleep(0.1)
|
|
198
|
+
|
|
199
|
+
def start(self):
|
|
200
|
+
self.status = True
|
|
201
|
+
protection = Thread(target=self.__monitor, daemon=True)
|
|
202
|
+
protection.start()
|
|
203
|
+
|
|
204
|
+
def stop(self):
|
|
205
|
+
self.status = False
|
|
206
|
+
|
|
182
207
|
class tool(login_2fac):
|
|
183
208
|
def find_element_with_wait(self, by, value, timeout=10):
|
|
184
209
|
global driver
|
|
@@ -252,9 +277,57 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
252
277
|
def __init__(self):
|
|
253
278
|
super().__init__()
|
|
254
279
|
|
|
255
|
-
def
|
|
280
|
+
def extension_check(self):
|
|
281
|
+
|
|
282
|
+
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
283
|
+
time.sleep(3)
|
|
284
|
+
|
|
285
|
+
for _ in range(10):
|
|
286
|
+
|
|
287
|
+
# Caso a extensão já esteja instalada
|
|
288
|
+
try:
|
|
289
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=1)
|
|
290
|
+
return
|
|
291
|
+
except: pass
|
|
256
292
|
|
|
257
|
-
|
|
293
|
+
try:
|
|
294
|
+
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]', timeout=1)
|
|
295
|
+
return
|
|
296
|
+
except: pass
|
|
297
|
+
|
|
298
|
+
# Caso a extensão não esteja instala
|
|
299
|
+
if 'This page has been blocked by Chrome' in driver.page_source:
|
|
300
|
+
break
|
|
301
|
+
|
|
302
|
+
if 'eliezer@bcfox.com.br' in self.driver.page_source:
|
|
303
|
+
tools.find_element_with_wait(By.XPATH, "//span[text()='alterar']").click()
|
|
304
|
+
return
|
|
305
|
+
|
|
306
|
+
# Abrir uma nova aba
|
|
307
|
+
self.driver.execute_script("window.open('');")
|
|
308
|
+
|
|
309
|
+
# Fechar a aba original
|
|
310
|
+
self.driver.close()
|
|
311
|
+
|
|
312
|
+
# Mudar para a nova aba
|
|
313
|
+
self.driver.switch_to.window(self.driver.window_handles[-1])
|
|
314
|
+
|
|
315
|
+
time.sleep(1)
|
|
316
|
+
|
|
317
|
+
self.driver.get("https://chromewebstore.google.com/detail/whom-gerenciador-de-certi/lnidijeaekolpfeckelhkomndglcglhh")
|
|
318
|
+
|
|
319
|
+
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
|
|
320
|
+
time.sleep(5)
|
|
321
|
+
|
|
322
|
+
# Envia TAB e ENTER do teclado físico
|
|
323
|
+
pyautogui.press('tab')
|
|
324
|
+
time.sleep(0.5)
|
|
325
|
+
pyautogui.press('enter')
|
|
326
|
+
time.sleep(5)
|
|
327
|
+
|
|
328
|
+
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
329
|
+
|
|
330
|
+
def codes_2_fac(self):
|
|
258
331
|
|
|
259
332
|
try:
|
|
260
333
|
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=2).send_keys(self.system)
|
|
@@ -412,58 +485,14 @@ def login_2fac(driver, certificate, system, token, code_timeout=60):
|
|
|
412
485
|
self.driver.close()
|
|
413
486
|
self.driver.switch_to.window(handles[-1])
|
|
414
487
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
418
|
-
time.sleep(3)
|
|
419
|
-
|
|
420
|
-
for _ in range(10):
|
|
421
|
-
|
|
422
|
-
# Caso a extensão já esteja instalada
|
|
423
|
-
try:
|
|
424
|
-
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Digite ou selecione um sistema pra acessar"]', timeout=1)
|
|
425
|
-
return
|
|
426
|
-
except: pass
|
|
427
|
-
|
|
428
|
-
try:
|
|
429
|
-
tools.find_element_with_wait(By.XPATH, '//input[@placeholder="Insira aqui o seu email"]', timeout=1)
|
|
430
|
-
return
|
|
431
|
-
except: pass
|
|
432
|
-
|
|
433
|
-
# Caso a extensão não esteja instala
|
|
434
|
-
if 'This page has been blocked by Chrome' in driver.page_source:
|
|
435
|
-
break
|
|
436
|
-
|
|
437
|
-
if 'eliezer@bcfox.com.br' in self.driver.page_source:
|
|
438
|
-
tools.find_element_with_wait(By.XPATH, "//span[text()='alterar']").click()
|
|
439
|
-
return
|
|
440
|
-
|
|
441
|
-
# Abrir uma nova aba
|
|
442
|
-
self.driver.execute_script("window.open('');")
|
|
443
|
-
|
|
444
|
-
# Fechar a aba original
|
|
445
|
-
self.driver.close()
|
|
446
|
-
|
|
447
|
-
# Mudar para a nova aba
|
|
448
|
-
self.driver.switch_to.window(self.driver.window_handles[-1])
|
|
449
|
-
|
|
450
|
-
time.sleep(1)
|
|
451
|
-
|
|
452
|
-
self.driver.get("https://chromewebstore.google.com/detail/whom-gerenciador-de-certi/lnidijeaekolpfeckelhkomndglcglhh")
|
|
453
|
-
|
|
454
|
-
tools.find_element_with_wait(By.XPATH, "//span[contains(text(), 'no Chrome') or contains(text(), 'Usar') or contains(text(), 'Add to Chrome')]").click()
|
|
455
|
-
time.sleep(5)
|
|
456
|
-
|
|
457
|
-
# Envia TAB e ENTER do teclado físico
|
|
458
|
-
pyautogui.press('tab')
|
|
459
|
-
time.sleep(0.5)
|
|
460
|
-
pyautogui.press('enter')
|
|
461
|
-
time.sleep(5)
|
|
462
|
-
|
|
463
|
-
self.driver.get('chrome-extension://lnidijeaekolpfeckelhkomndglcglhh/index.html')
|
|
464
|
-
|
|
488
|
+
# Instances
|
|
465
489
|
tools = tool()
|
|
466
490
|
api = invokes_whoom()
|
|
491
|
+
protection = Pop_up_protection()
|
|
467
492
|
bot = whoom_codes()
|
|
468
493
|
|
|
494
|
+
# Operacional
|
|
495
|
+
bot.extension_check()
|
|
496
|
+
protection.start()
|
|
469
497
|
bot.codes_2_fac()
|
|
498
|
+
protection.stop()
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
bcpkgfox/__init__.py,sha256=49TPbTUNI6xKcYk4blwseUZQTgHtRcNI1AFEqxSQ3wY,16540
|
|
2
2
|
bcpkgfox/clean.py,sha256=80pJDTGmKmPiq73uL1IWopuxqVJF_bj_RVv-njkpl-A,8946
|
|
3
|
-
bcpkgfox/cli.py,sha256=
|
|
3
|
+
bcpkgfox/cli.py,sha256=E1Yahd8jIjUwxM6EMHveDDne5-fh8QeAvAhyATNatEo,33541
|
|
4
4
|
bcpkgfox/exec_file.py,sha256=fl_Do2SlF7JuXazpNTod-e_0WZUk355fbd7ustQvi40,3728
|
|
5
5
|
bcpkgfox/find_elements.py,sha256=oeB-73LqMLoKchozPXuxRkThBju9IgUKqbgU-2AAq0s,23027
|
|
6
6
|
bcpkgfox/get_driver.py,sha256=ohimk9E2hL6T35IXv0XX0uvWDGCUZvZDlPMnuRjV1R0,30490
|
|
7
|
-
bcpkgfox/invoke_api.py,sha256=
|
|
7
|
+
bcpkgfox/invoke_api.py,sha256=JP7kyZ-tTcqnFENoxGzmjLqPI6Ho46vy-C-K0qlndo8,18634
|
|
8
8
|
bcpkgfox/system.py,sha256=3lyOWx893T6KiAI-jDv7zAo3oKPf0Q5CLgZ8TeFd0Do,7901
|
|
9
|
-
bcpkgfox-0.16.
|
|
10
|
-
bcpkgfox-0.16.
|
|
11
|
-
bcpkgfox-0.16.
|
|
12
|
-
bcpkgfox-0.16.
|
|
13
|
-
bcpkgfox-0.16.
|
|
9
|
+
bcpkgfox-0.16.72.dist-info/METADATA,sha256=Vp1XtlU9Xwrir2ijbv2002sThJOzMOqV6P6sdqEHkvI,1912
|
|
10
|
+
bcpkgfox-0.16.72.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
11
|
+
bcpkgfox-0.16.72.dist-info/entry_points.txt,sha256=qmaEg6K7Y0HOeaFo-G6lf44InGkeVI4I6hqobcY_nns,653
|
|
12
|
+
bcpkgfox-0.16.72.dist-info/top_level.txt,sha256=h01SqyYBEfS72vkRFOlEDZBUSu9pzU0bdX4m9hWNNmw,9
|
|
13
|
+
bcpkgfox-0.16.72.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|