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 Dec 29, 2024
1 parent 88f0528 commit c96849d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions bot/helper/listeners/mega_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ def onTransferTemporaryError(self, _, transfer, error): # noqa: N802
)
if transfer.getState() in [1, 4]:
return
self.error = f"TransferTempError: {error.toString()} ({transfer.getFileName()})"
self.error = (
f"TransferTempError: {error.toString()} ({transfer.getFileName()})"
)
if not self.is_cancelled:
self.is_cancelled = True
self.continue_event.set()

async def cancel_task(self):
self.is_cancelled = True
await self.listener.on_download_error("Download Canceled by user")
await self.listener.on_download_error("Download Canceled by user")
7 changes: 5 additions & 2 deletions bot/helper/mirror_leech_utils/download_utils/mega_download.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from secrets import token_hex

from aiofiles.os import makedirs
from mega import MegaApi

Expand Down Expand Up @@ -91,7 +92,9 @@ async def add_mega_download(listener, path):
from_queue = False

async with task_dict_lock:
task_dict[listener.mid] = MegaDownloadStatus(listener, mega_listener, gid, "dl")
task_dict[listener.mid] = MegaDownloadStatus(
listener, mega_listener, gid, "dl"
)
async with queue_dict_lock:
non_queued_dl.add(listener.mid)

Expand All @@ -108,4 +111,4 @@ async def add_mega_download(listener, path):
api.startDownload,
(node, path, listener.name, None, False, None),
)
await mega_logout(executor, api, folder_api)
await mega_logout(executor, api, folder_api)
4 changes: 3 additions & 1 deletion bot/helper/telegram_helper/message_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ async def get_tg_link_message(link, user_id=""):

if not private:
try:
message = await TgClient.bot.get_messages(chat_id=chat, message_ids=msg_id)
message = await TgClient.bot.get_messages(
chat_id=chat, message_ids=msg_id
)
if message.empty:
private = True
except Exception as e:
Expand Down
8 changes: 4 additions & 4 deletions bot/modules/mirror_leech.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from bot.helper.ext_utils.exceptions import DirectDownloadLinkException
from bot.helper.ext_utils.links_utils import (
is_gdrive_id,
is_mega_link,
is_gdrive_link,
is_magnet,
is_mega_link,
is_rclone_path,
is_telegram_link,
is_url,
Expand All @@ -28,13 +28,13 @@
from bot.helper.mirror_leech_utils.download_utils.direct_downloader import (
add_direct_download,
)
from bot.helper.mirror_leech_utils.download_utils.mega_download import (
add_mega_download,
)
from bot.helper.mirror_leech_utils.download_utils.direct_link_generator import (
direct_link_generator,
)
from bot.helper.mirror_leech_utils.download_utils.gd_download import add_gd_download
from bot.helper.mirror_leech_utils.download_utils.mega_download import (
add_mega_download,
)
from bot.helper.mirror_leech_utils.download_utils.qbit_download import add_qb_torrent
from bot.helper.mirror_leech_utils.download_utils.rclone_download import (
add_rclone_download,
Expand Down

0 comments on commit c96849d

Please sign in to comment.