Skip to content

Commit

Permalink
Auto-format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Aug 11, 2024
1 parent f8fc532 commit ff181ab
Show file tree
Hide file tree
Showing 56 changed files with 469 additions and 467 deletions.
2 changes: 1 addition & 1 deletion alive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import os
import time
import logging

import requests

Expand Down
30 changes: 15 additions & 15 deletions bot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import sys
from os import path as ospath
from os import remove as osremove
from os import environ
from time import time, sleep
from socket import setdefaulttimeout
from asyncio import Lock
from faulthandler import enable as faulthandler_enable
from logging import (
ERROR,
INFO,
FileHandler,
ERROR,
Formatter,
FileHandler,
StreamHandler,
basicConfig,
error,
getLogger,
warning,
getLogger,
basicConfig,
)
from os import environ
from os import path as ospath
from os import remove as osremove
from socket import setdefaulttimeout
from threading import Thread
from subprocess import Popen, check_output
from subprocess import run as srun
from threading import Thread
from time import sleep, time
from faulthandler import enable as faulthandler_enable

from apscheduler.schedulers.asyncio import AsyncIOScheduler
from aria2p import API as ariaAPI
from aria2p import Client as ariaClient
from dotenv import dotenv_values, load_dotenv
from dotenv import load_dotenv, dotenv_values
from uvloop import install
from pymongo import MongoClient
from tzlocal import get_localzone
from pyrogram import Client as tgClient
from pyrogram import enums
from qbittorrentapi import Client as qbClient
from tzlocal import get_localzone
from uvloop import install
from apscheduler.schedulers.asyncio import AsyncIOScheduler

faulthandler_enable()
install()
Expand Down
74 changes: 37 additions & 37 deletions bot/__main__.py
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
# ruff: noqa: F401
import contextlib
from asyncio import create_subprocess_exec, gather
from html import escape
from os import execl as osexecl
from signal import SIGINT, signal
from sys import executable
from html import escape
from time import time
from uuid import uuid4
from signal import SIGINT, signal
from asyncio import gather, create_subprocess_exec

from psutil import boot_time, disk_usage, cpu_percent, virtual_memory
from aiofiles import open as aiopen
from aiofiles.os import path as aiopath
from aiofiles.os import remove as aioremove
from psutil import boot_time, cpu_percent, disk_usage, virtual_memory
from pyrogram.filters import command, regex
from pyrogram.handlers import CallbackQueryHandler, MessageHandler
from pyrogram.filters import regex, command
from pyrogram.handlers import MessageHandler, CallbackQueryHandler

from bot import (
DATABASE_URL,
LOGGER,
DATABASE_URL,
Interval,
QbInterval,
bot,
bot_name,
botStartTime,
config_dict,
scheduler,
user_data,
config_dict,
botStartTime,
)

from .modules import (
list,
clone,
count,
shell,
ytdlp,
delete,
images,
status,
executor,
authorize,
broadcast,
mediainfo,
speedtest,
bot_settings,
mirror_leech,
cancel_mirror,
torrent_search,
torrent_select,
users_settings,
)
from .helper.ext_utils.bot_utils import (
get_readable_file_size,
get_readable_time,
new_task,
new_thread,
set_commands,
sync_to_async,
get_readable_time,
get_readable_file_size,
)
from .helper.ext_utils.db_handler import DbManager
from .helper.ext_utils.files_utils import clean_all, exit_clean_up, start_cleanup
from .helper.telegram_helper.filters import CustomFilters
from .helper.listeners.aria2_listener import start_aria2_listener
from .helper.telegram_helper.bot_commands import BotCommands
from .helper.telegram_helper.button_build import ButtonMaker
from .helper.telegram_helper.filters import CustomFilters
from .helper.telegram_helper.message_utils import (
deleteMessage,
editMessage,
five_minute_del,
one_minute_del,
sendFile,
editMessage,
sendMessage,
)
from .modules import (
authorize,
bot_settings,
broadcast,
cancel_mirror,
clone,
count,
delete,
executor,
images,
list,
mediainfo,
mirror_leech,
shell,
speedtest,
status,
torrent_search,
torrent_select,
users_settings,
ytdlp,
deleteMessage,
one_minute_del,
five_minute_del,
)

if config_dict["GDRIVE_ID"]:
Expand Down
2 changes: 1 addition & 1 deletion bot/helper/aeon_utils/metadata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
import os
import json
from asyncio import create_subprocess_exec
from asyncio.subprocess import PIPE

Expand Down
30 changes: 15 additions & 15 deletions bot/helper/ext_utils/bot_utils.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import contextlib
from os import path as ospath
from re import match as re_match
from html import escape
from time import time
from uuid import uuid4
from asyncio import (
sleep,
create_subprocess_exec,
create_subprocess_shell,
run_coroutine_threadsafe,
sleep,
)
from functools import wraps, partial
from urllib.parse import urlparse
from asyncio.subprocess import PIPE
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
from html import escape
from os import path as ospath
from re import match as re_match
from time import time
from urllib.parse import urlparse
from uuid import uuid4

from psutil import disk_usage
from aiohttp import ClientSession as aioClientSession
from aiofiles import open as aiopen
from aiofiles.os import mkdir
from aiofiles.os import path as aiopath
from aiohttp import ClientSession as aioClientSession
from psutil import disk_usage
from aiofiles.os import mkdir
from pyrogram.types import BotCommand

from bot import (
DATABASE_URL,
LOGGER,
DATABASE_URL,
bot_loop,
bot_name,
botStartTime,
user_data,
config_dict,
botStartTime,
download_dict,
download_dict_lock,
extra_buttons,
user_data,
download_dict_lock,
)
from bot.helper.aeon_utils.tinyfy import tinyfy
from bot.helper.ext_utils.db_handler import DbManager
Expand Down
10 changes: 5 additions & 5 deletions bot/helper/ext_utils/db_handler.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from aiofiles import open as aiopen
from aiofiles.os import makedirs
from aiofiles.os import path as aiopath
from motor.motor_asyncio import AsyncIOMotorClient
from aiofiles.os import makedirs
from pymongo.errors import PyMongoError
from motor.motor_asyncio import AsyncIOMotorClient

from bot import (
DATABASE_URL,
LOGGER,
aria2_options,
DATABASE_URL,
bot_id,
bot_loop,
user_data,
config_dict,
qbit_options,
user_data,
aria2_options,
)


Expand Down
38 changes: 19 additions & 19 deletions bot/helper/ext_utils/files_utils.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import contextlib
from asyncio import create_subprocess_exec, create_task, gather
from asyncio.subprocess import PIPE
from hashlib import md5
from os import path as ospath
from os import walk
from re import IGNORECASE
from re import search as re_search
from re import split as re_split
from re import sub as re_sub
from re import split as re_split
from re import search as re_search
from sys import exit as sexit
from time import time, gmtime, strftime
from shlex import split as ssplit
from shutil import disk_usage, rmtree
from shutil import rmtree, disk_usage
from asyncio import gather, create_task, create_subprocess_exec
from hashlib import md5
from subprocess import run as srun
from sys import exit as sexit
from time import gmtime, strftime, time
from asyncio.subprocess import PIPE

from aiofiles.os import listdir, makedirs, mkdir, rmdir
from aiofiles.os import path as aiopath
from aiofiles.os import remove as aioremove
from aioshutil import rmtree as aiormtree
from langcodes import Language
from magic import Magic
from natsort import natsorted
from aioshutil import rmtree as aiormtree
from langcodes import Language
from telegraph import upload_file
from aiofiles.os import path as aiopath
from aiofiles.os import mkdir, rmdir, listdir, makedirs
from aiofiles.os import remove as aioremove

from bot import (
GLOBAL_EXTENSION_FILTER,
LOGGER,
MAX_SPLIT_SIZE,
GLOBAL_EXTENSION_FILTER,
aria2,
config_dict,
user_data,
config_dict,
xnox_client,
)
from bot.modules.mediainfo import parseinfo
from bot.helper.aeon_utils.metadata import change_metadata
from bot.helper.ext_utils.bot_utils import (
cmd_exec,
get_readable_file_size,
get_readable_time,
isMkv,
cmd_exec,
sync_to_async,
get_readable_time,
get_readable_file_size,
)
from bot.helper.ext_utils.telegraph_helper import telegraph
from bot.modules.mediainfo import parseinfo

from .exceptions import NotSupportedExtractionArchive

Expand Down
4 changes: 2 additions & 2 deletions bot/helper/ext_utils/shorteners.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from time import sleep
from base64 import b64encode
from random import choice, random, randrange
from time import sleep
from urllib.parse import quote

from cloudscraper import create_scraper
from urllib3 import disable_warnings
from cloudscraper import create_scraper

from bot import LOGGER, shorteners_list

Expand Down
16 changes: 8 additions & 8 deletions bot/helper/ext_utils/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
from bot import (
LOGGER,
OWNER_ID,
queued_dl,
queued_up,
user_data,
config_dict,
download_dict,
non_queued_dl,
non_queued_up,
queue_dict_lock,
queued_dl,
queued_up,
user_data,
)
from bot.helper.ext_utils.bot_utils import (
sync_to_async,
get_user_tasks,
checking_access,
get_readable_file_size,
get_telegraph_list,
get_user_tasks,
sync_to_async,
get_readable_file_size,
)
from bot.helper.ext_utils.files_utils import check_storage_threshold, get_base_name
from bot.helper.ext_utils.files_utils import get_base_name, check_storage_threshold
from bot.helper.telegram_helper.message_utils import BotPm_check, isAdmin, forcesub
from bot.helper.mirror_leech_utils.upload_utils.gdriveTools import GoogleDriveHelper
from bot.helper.telegram_helper.message_utils import BotPm_check, forcesub, isAdmin


async def stop_duplicate_check(name, listener):
Expand Down
Loading

0 comments on commit ff181ab

Please sign in to comment.