mirror of
https://github.com/anatolykopyl/dochunt.git
synced 2026-03-26 12:54:41 +00:00
🚀 Somewhat working version
This commit is contained in:
19
utils/authenticate.py
Normal file
19
utils/authenticate.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import vk_api
|
||||
import configparser
|
||||
from rich.console import Console
|
||||
c = Console()
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
login = config['CREDENTIALS']['login']
|
||||
password = config['CREDENTIALS']['password']
|
||||
|
||||
def _2fa_handler():
|
||||
code = c.input("Enter 2FA code: ", style="italic cyan")
|
||||
return code, True
|
||||
|
||||
def authenticate():
|
||||
vk_session = vk_api.VkApi(login=login, password=password, auth_handler=_2fa_handler)
|
||||
vk_session.auth()
|
||||
|
||||
return vk_session.get_api()
|
||||
9
utils/detect.py
Normal file
9
utils/detect.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import pytesseract
|
||||
from PIL import Image
|
||||
import io
|
||||
import requests
|
||||
|
||||
def detect(url):
|
||||
response = requests.get(url)
|
||||
img = Image.open(io.BytesIO(response.content))
|
||||
return pytesseract.image_to_string(img).lower()
|
||||
Reference in New Issue
Block a user