🚸 Made output html instead of txt

This commit is contained in:
2021-04-06 18:24:54 +03:00
parent 1d88d0e936
commit 9107c3a0f4
4 changed files with 51 additions and 28 deletions

View File

@@ -5,5 +5,9 @@ import requests
def detect(url):
response = requests.get(url)
img = Image.open(io.BytesIO(response.content))
try:
img = Image.open(io.BytesIO(response.content))
except OSError:
return ''
return pytesseract.image_to_string(img, lang='rus', timeout=30).lower()