Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
Added token logger

Signed-off-by: Dawn India <[email protected]>
  • Loading branch information
Dawn-India committed Nov 8, 2024
1 parent a42d1b3 commit 46af496
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
4 changes: 4 additions & 0 deletions bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
qb_torrents = {}
jd_downloads = {}
nzb_jobs = {}

drives_names = []
drives_ids = []
index_urls = []
Expand All @@ -99,13 +100,15 @@
"!qB"
]
shorteneres_list = []

extra_buttons = {}
user_data = {}
aria2_options = {}
qbit_options = {}
nzb_options = {}
queued_dl = {}
queued_up = {}

non_queued_dl = set()
non_queued_up = set()
multi_tags = set()
Expand All @@ -125,6 +128,7 @@
cpu_eater_lock = Lock()
subprocess_lock = Lock()
same_directory_lock = Lock()

status_dict = {}
task_dict = {}
rss_dict = {}
Expand Down
17 changes: 14 additions & 3 deletions bot/helper/ext_utils/files_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ async def clean_unwanted(path, custom_list=None):
dirpath,
ignore_errors=True
)
for dirpath, _, files in await sync_to_async(
for (
dirpath,
_,
files
) in await sync_to_async(
walk,
path,
topdown=False
Expand All @@ -210,12 +214,19 @@ async def get_path_size(path):
if await aiopath.isfile(path):
return await aiopath.getsize(path)
total_size = 0
for root, _, files in await sync_to_async(
for (
root,
_,
files
) in await sync_to_async(
walk,
path
):
for f in files:
abs_path = ospath.join(root, f)
abs_path = ospath.join(
root,
f
)
total_size += await aiopath.getsize(abs_path)
return total_size

Expand Down
8 changes: 7 additions & 1 deletion bot/helper/ext_utils/token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,16 @@ async def start(client, message):
"<b>Your Limites:</b>\n"
f"➜ {config_dict["USER_MAX_TASKS"]} parallal tasks.\n"
)
return await send_message(
await send_message(
message,
msg
)
await send_log_message(
message,
f"#TOKEN\n\nToken refreshed successfully.",
tag
)
return
elif (
config_dict["DM_MODE"]
and message.chat.type != message.chat.type.SUPERGROUP
Expand Down
2 changes: 1 addition & 1 deletion bot/helper/telegram_helper/message_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def send_message(message, text, buttons=None, block=True):

async def edit_message(message, text, buttons=None, block=True):
try:
await message.edit(
return await message.edit(
text=text,
disable_web_page_preview=True,
reply_markup=buttons
Expand Down
5 changes: 4 additions & 1 deletion bot/modules/users_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ async def set_option(message, option):
elif option == "excluded_extensions":
fx = config_dict["EXTENSION_FILTER"].split()
fx += value.split()
value = ["aria2", "!qB"]
value = [
"aria2",
"!qB"
]
for x in fx:
x = x.lstrip(".")
value.append(x.strip().lower())
Expand Down

0 comments on commit 46af496

Please sign in to comment.