mirror of
https://github.com/anatolykopyl/dochunt.git
synced 2026-03-26 12:54:41 +00:00
🚸 Made output html instead of txt
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
from rich.console import Console
|
||||
import calendar;
|
||||
import time;
|
||||
c = Console()
|
||||
ts = calendar.timegm(time.gmtime())
|
||||
|
||||
def save_photo(url):
|
||||
f = open("output.txt", "a", encoding='utf-8')
|
||||
f.write(url)
|
||||
f = open(f"output/{ts}.html", "a", encoding='utf-8')
|
||||
f.write(f'<img width=400 src="{url}"><br>')
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user