diff --git a/modules/api_client.py b/modules/api_client.py index d364e7d..14d4123 100644 --- a/modules/api_client.py +++ b/modules/api_client.py @@ -1,26 +1,20 @@ """This is only a temporary solution. Complete Photos API client is yet to be developed.""" -try: - from ujson import dumps -except ModuleNotFoundError: - from json import dumps - import asyncio from base64 import b64decode, b64encode -from traceback import print_exc -import aiofiles -from ujson import dumps from os import makedirs, path, sep from random import choice +from traceback import print_exc from typing import Tuple, Union + +import aiofiles from aiohttp import ClientSession, FormData +from ujson import dumps from classes.exceptions import SubmissionUploadError - from modules.logger import logWrite from modules.utils import configGet - http_session = ClientSession( json_serialize=dumps, ) diff --git a/modules/logger.py b/modules/logger.py index a69104d..0f32b14 100644 --- a/modules/logger.py +++ b/modules/logger.py @@ -1,13 +1,9 @@ -try: - from ujson import loads -except ModuleNotFoundError: - from json import loads - -from os import stat, makedirs, path, getcwd +from datetime import datetime from gzip import open as gzipopen +from os import getcwd, makedirs, path, stat from shutil import copyfileobj -from datetime import datetime +from ujson import loads with open(getcwd() + path.sep + "config.json", "r", encoding="utf8") as file: json_contents = loads(file.read()) diff --git a/modules/utils.py b/modules/utils.py index 0f7f809..34edf99 100644 --- a/modules/utils.py +++ b/modules/utils.py @@ -1,16 +1,12 @@ -try: - from ujson import JSONDecodeError as JSONDecodeError - from ujson import loads, dumps -except ModuleNotFoundError: - from json import JSONDecodeError as JSONDecodeError - from json import loads, dumps - -from sys import exit -from os import sep, kill +from os import kill from os import name as osname +from os import sep +from sys import exit from traceback import print_exc from typing import Any +from ujson import JSONDecodeError, dumps, loads + from modules.logger import logWrite diff --git a/requirements-optional.txt b/requirements-optional.txt index e67bbe1..717d475 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -1,2 +1 @@ -ujson~=5.7.0 tgcrypto~=1.2.5 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index feb0c35..fd2b3d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,9 @@ apscheduler~=3.10.1 pyrogram~=2.0.101 -aiohttp~=3.8.4 +pytimeparse~=1.1.8 aiofiles~=23.1.0 +aiohttp~=3.8.4 psutil~=5.9.4 pymongo~=4.3.3 pillow~=9.4.0 -pytimeparse~=1.1.8 \ No newline at end of file +ujson~=5.7.0 \ No newline at end of file