Skip to content

Commit

Permalink
remove oscrypto
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed Jan 20, 2024
1 parent f622f24 commit 31066c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions manga_translator/server/web_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import time
import asyncio
import subprocess
import secrets
from io import BytesIO
from PIL import Image
from aiohttp import web
from collections import deque
from imagehash import phash
from oscrypto import util as crypto_utils

SERVER_DIR_PATH = os.path.dirname(os.path.realpath(__file__))
BASE_PATH = os.path.dirname(os.path.dirname(SERVER_DIR_PATH))
Expand Down Expand Up @@ -461,7 +461,7 @@ async def manual_translate_async(request):
img, size, selected_translator, target_language, detector, direction = x
else:
return x
task_id = crypto_utils.rand_bytes(16).hex()
task_id = secrets.token_hex(16)
print(f'New `manual-translate` task {task_id}')
os.makedirs(f'result/{task_id}/', exist_ok=True)
img = img.convert('RGB')
Expand Down Expand Up @@ -497,7 +497,7 @@ async def manual_translate_async(request):


def generate_nonce():
return crypto_utils.rand_bytes(16).hex()
return secrets.token_hex(16)

def start_translator_client_proc(host: str, port: int, nonce: str, params: dict):
os.environ['MT_WEB_NONCE'] = nonce
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ opencv-python
pyclipper
shapely
requests
git+https://github.com/wbond/oscrypto
cryptography
freetype-py
googletrans==4.0.0rc1
Expand All @@ -34,6 +33,7 @@ open_clip_torch
safetensors
pandas
onnxruntime
timm
omegaconf
python-dotenv
nest-asyncio
Expand Down

0 comments on commit 31066c1

Please sign in to comment.