This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set FILENAME=%~p1%~n1 | |
set EXT=%~x1 | |
set FILENAME-WITH-EXT=%FILENAME%.png | |
set QUALITY=16 | |
IF NOT "%EXT%"==".png" ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jeepney import DBusAddress, new_method_call | |
from jeepney.bus_messages import message_bus, MatchRule | |
from jeepney.io.blocking import open_dbus_connection, Proxy | |
from urllib.parse import unquote | |
from pathlib import Path | |
from tempfile import mkstemp | |
import pyocr, io, subprocess, numpy, cv2, screeninfo, time | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2, json, asyncio, numpy | |
from urllib.parse import urlparse | |
from aiohttp import ClientSession | |
def solve(file: bytes, page: int) -> None: | |
np_array = numpy.frombuffer(file, numpy.uint8) | |
image = cv2.imdecode(np_array, cv2.IMREAD_COLOR) | |
new_image = image.copy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path, PurePosixPath | |
import pkg_resources as dist | |
try: dist.require(['tomli']) # python -m pip install tomli | |
except dist.DistributionNotFound as Error: | |
exit(Error.report() + f'\nThe following dependency is missing: {Error.req}"') | |
from tomli import load as parse_toml |