Skip to content

Commit 41ce992

Browse files
v1.1.5 🔗 LINKS, PARSE, SHOW ...
1) LINKS_LOG_ID Added (Single), Complete Logging System. 2) LEECH_SPLIT_SIZE fixed on Adding USER_SESSION_STRING 3) Bot PM, Bot Start Fixed for Non-started Users 4) Dump Channel SAVE MSG removed 5) Bot PM added Reply to Task Added Msg. 6) Added SHOW_EXTRA_CMDS, used for Old Use of All Zip & UnZip cmds + Usage of Args 7) Miror Log & Leech Log --> Multiple! 8) CLEAN_LOG_MSG Added to Make LEECH_LOG Clean 9) Added {md5_hash} extra Filling in Caption 10) Added Magnet URLs, On Tg Files, All Details.. 11) Fixed Premium Upload File Issue 12) Changed View in Bot Button to Inline Button, Now Only its User can Go to PM. 13) Speed Up on Start cmd **MORE UPCOMING, PUSHED TO FIX THE ERRORS !** `( EXCEP_CHATS, BLACKLIST_USER, DISABLE_MODULES )` Thanks You, for Checking out, Now go Explore in Bot 🛠.... ( Hit More Stars 🌟 to Motivate ) 👓 ------- Co-authored-by: mlbtheroku <[email protected]>
1 parent 34338a3 commit 41ce992

17 files changed

+316
-156
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ data*
99
log.txt
1010
accounts/*
1111
Thumbnails/*
12+
MediaInfo/*
13+
Images/*
1214
rclone/*
1315
list_drives.txt
1416
cookies.txt

_config.yml

-1
This file was deleted.

bot/__init__.py

+20-8
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
def get_version():
5555
MAJOR = '1'
5656
MINOR = '1'
57-
PATCH = '4'
57+
PATCH = '5'
5858
return f"v{MAJOR}.{MINOR}.{PATCH}-x"
5959

6060

@@ -261,7 +261,7 @@ def changetz(*args):
261261
MAX_SPLIT_SIZE = 4194304000 if IS_PREMIUM_USER else 2097152000
262262

263263
LEECH_SPLIT_SIZE = environ.get('LEECH_SPLIT_SIZE', '')
264-
if len(LEECH_SPLIT_SIZE) == 0 or int(LEECH_SPLIT_SIZE) > MAX_SPLIT_SIZE:
264+
if str(LEECH_SPLIT_SIZE) in ["4194304000", "2097152000"] or len(LEECH_SPLIT_SIZE) == 0 or int(LEECH_SPLIT_SIZE) > MAX_SPLIT_SIZE:
265265
LEECH_SPLIT_SIZE = MAX_SPLIT_SIZE
266266
else:
267267
LEECH_SPLIT_SIZE = int(LEECH_SPLIT_SIZE)
@@ -288,9 +288,6 @@ def changetz(*args):
288288
SEARCH_LIMIT = environ.get('SEARCH_LIMIT', '')
289289
SEARCH_LIMIT = 0 if len(SEARCH_LIMIT) == 0 else int(SEARCH_LIMIT)
290290

291-
LEECH_LOG_ID = environ.get('LEECH_LOG_ID', '')
292-
LEECH_LOG_ID = '' if len(LEECH_LOG_ID) == 0 else int(LEECH_LOG_ID)
293-
294291
STATUS_LIMIT = environ.get('STATUS_LIMIT', '')
295292
STATUS_LIMIT = 6 if len(STATUS_LIMIT) == 0 else int(STATUS_LIMIT)
296293

@@ -380,8 +377,7 @@ def changetz(*args):
380377
RCLONE_SERVE_PASS = ''
381378

382379
STORAGE_THRESHOLD = environ.get('STORAGE_THRESHOLD', '')
383-
STORAGE_THRESHOLD = '' if len(
384-
STORAGE_THRESHOLD) == 0 else float(STORAGE_THRESHOLD)
380+
STORAGE_THRESHOLD = '' if len(STORAGE_THRESHOLD) == 0 else float(STORAGE_THRESHOLD)
385381

386382
TORRENT_LIMIT = environ.get('TORRENT_LIMIT', '')
387383
TORRENT_LIMIT = '' if len(TORRENT_LIMIT) == 0 else float(TORRENT_LIMIT)
@@ -413,10 +409,17 @@ def changetz(*args):
413409
FSUB_IDS = environ.get('FSUB_IDS', '')
414410
if len(FSUB_IDS) == 0:
415411
FSUB_IDS = ''
412+
413+
LINKS_LOG_ID = environ.get('LINKS_LOG_ID', '')
414+
LINKS_LOG_ID = '' if len(LINKS_LOG_ID) == 0 else int(LINKS_LOG_ID)
416415

417416
MIRROR_LOG_ID = environ.get('MIRROR_LOG_ID', '')
418417
if len(MIRROR_LOG_ID) == 0:
419418
MIRROR_LOG_ID = ''
419+
420+
LEECH_LOG_ID = environ.get('LEECH_LOG_ID', '')
421+
if len(LEECH_LOG_ID) == 0:
422+
LEECH_LOG_ID = ''
420423

421424
BOT_PM = environ.get('BOT_PM', '')
422425
BOT_PM = BOT_PM.lower() == 'true'
@@ -462,7 +465,7 @@ def changetz(*args):
462465

463466
TITLE_NAME = environ.get('TITLE_NAME', '')
464467
if len(TITLE_NAME) == 0:
465-
TITLE_NAME = 'WZ M/L X'
468+
TITLE_NAME = 'WZ-M/L-X'
466469

467470
GD_INFO = environ.get('GD_INFO', '')
468471
if len(GD_INFO) == 0:
@@ -477,6 +480,12 @@ def changetz(*args):
477480
SET_COMMANDS = environ.get('SET_COMMANDS', '')
478481
SET_COMMANDS = SET_COMMANDS.lower() == 'true'
479482

483+
CLEAN_LOG_MSG = environ.get('CLEAN_LOG_MSG', '')
484+
CLEAN_LOG_MSG = CLEAN_LOG_MSG.lower() == 'true'
485+
486+
SHOW_EXTRA_CMDS = environ.get('SHOW_EXTRA_CMDS', '')
487+
SHOW_EXTRA_CMDS = SHOW_EXTRA_CMDS.lower() == 'true'
488+
480489
TOKEN_TIMEOUT = environ.get('TOKEN_TIMEOUT', '')
481490
TOKEN_TIMEOUT = int(TOKEN_TIMEOUT) if TOKEN_TIMEOUT.isdigit() else ''
482491

@@ -562,6 +571,7 @@ def changetz(*args):
562571
'DAILY_LEECH_LIMIT': DAILY_LEECH_LIMIT,
563572
'MIRROR_LOG_ID': MIRROR_LOG_ID,
564573
'LEECH_LOG_ID': LEECH_LOG_ID,
574+
'LINKS_LOG_ID': LINKS_LOG_ID,
565575
'BOT_PM': BOT_PM,
566576
'DISABLE_DRIVE_LINK': DISABLE_DRIVE_LINK,
567577
'BOT_THEME': BOT_THEME,
@@ -613,6 +623,8 @@ def changetz(*args):
613623
'SEARCH_PLUGINS': SEARCH_PLUGINS,
614624
'SET_COMMANDS': SET_COMMANDS,
615625
'SHOW_MEDIAINFO': SHOW_MEDIAINFO,
626+
'CLEAN_LOG_MSG': CLEAN_LOG_MSG,
627+
'SHOW_EXTRA_CMDS': SHOW_EXTRA_CMDS,
616628
'SOURCE_LINK': SOURCE_LINK,
617629
'STATUS_LIMIT': STATUS_LIMIT,
618630
'STATUS_UPDATE_INTERVAL': STATUS_UPDATE_INTERVAL,

bot/__main__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ async def stats(client, message):
8383

8484
@new_task
8585
async def start(client, message):
86-
await DbManger().update_pm_users(message.from_user.id)
8786
buttons = ButtonMaker()
8887
buttons.ubutton(BotTheme('ST_BN1_NAME'), BotTheme('ST_BN1_URL'))
8988
buttons.ubutton(BotTheme('ST_BN2_NAME'), BotTheme('ST_BN2_URL'))
9089
reply_markup = buttons.build_menu(2)
91-
if len(message.command) > 1 and config_dict['TOKEN_TIMEOUT']:
90+
if len(message.command) > 1 and message.command[1] == "wzmlx":
91+
await message.delete()
92+
elif len(message.command) > 1 and config_dict['TOKEN_TIMEOUT']:
9293
userid = message.from_user.id
9394
encrypted_url = message.command[1]
9495
input_token, pre_uid = (b64decode(encrypted_url.encode()).decode()).split('&&')
@@ -112,6 +113,8 @@ async def start(client, message):
112113
await sendMessage(message, BotTheme('ST_BOTPM'), reply_markup, photo='IMAGES')
113114
else:
114115
await sendMessage(message, BotTheme('ST_UNAUTH'), reply_markup, photo='IMAGES')
116+
await DbManger().update_pm_users(message.from_user.id)
117+
115118

116119
async def token_callback(_, query):
117120
user_id = query.from_user.id
@@ -125,7 +128,8 @@ async def token_callback(_, query):
125128
kb = query.message.reply_markup.inline_keyboard[1:]
126129
kb.insert(0, [InlineKeyboardButton('✅️ Activated ✅', callback_data='pass activated')])
127130
await query.edit_message_reply_markup(InlineKeyboardMarkup(kb))
128-
131+
132+
129133
async def login(_, message):
130134
if config_dict['LOGIN_PASS'] is None:
131135
return
@@ -142,6 +146,7 @@ async def login(_, message):
142146
else:
143147
await sendMessage(message, '<b>Bot Login Usage :</b>\n\n<code>/cmd {password}</code>')
144148

149+
145150
async def restart(client, message):
146151
restart_message = await sendMessage(message, BotTheme('RESTARTING'))
147152
if scheduler.running:

bot/helper/ext_utils/bot_utils.py

+15-3
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def extra_btns(buttons):
534534
async def set_commands(client):
535535
if config_dict['SET_COMMANDS']:
536536
try:
537-
await client.set_bot_commands([
537+
bot_cmds = [
538538
BotCommand(BotCommands.MirrorCommand[0], f'or /{BotCommands.MirrorCommand[1]} Mirror [links/media/rclone_path]'),
539539
BotCommand(BotCommands.LeechCommand[0], f'or /{BotCommands.LeechCommand[1]} Leech [links/media/rclone_path]'),
540540
BotCommand(BotCommands.QbMirrorCommand[0], f'or /{BotCommands.QbMirrorCommand[1]} Mirror magnet/torrent using qBittorrent'),
@@ -544,7 +544,7 @@ async def set_commands(client):
544544
BotCommand(BotCommands.CloneCommand[0], f'or /{BotCommands.CloneCommand[1]} Copy file/folder to Drive (GDrive/RClone)'),
545545
BotCommand(BotCommands.CountCommand, '[drive_url]: Count file/folder of Google Drive/RClone Drives'),
546546
BotCommand(BotCommands.StatusCommand[0], f'or /{BotCommands.StatusCommand[1]} Get Bot All Status Stats Message'),
547-
BotCommand(BotCommands.StatsCommand[0], f'or /{BotCommands.StatsCommand[1]}Check Bot & System stats'),
547+
BotCommand(BotCommands.StatsCommand[0], f'or /{BotCommands.StatsCommand[1]} Check Bot & System stats'),
548548
BotCommand(BotCommands.BtSelectCommand, 'Select files to download only torrents/magnet qbit/aria2c'),
549549
BotCommand(BotCommands.CancelMirror, 'Cancel a Task of yours!'),
550550
BotCommand(BotCommands.CancelAllCommand[0], f'Cancel all Tasks in whole Bots.'),
@@ -559,7 +559,19 @@ async def set_commands(client):
559559
BotCommand(BotCommands.MediaInfoCommand[0], f'or /{BotCommands.MediaInfoCommand[1]} Generate Mediainfo for Replied Media or DL links'),
560560
BotCommand(BotCommands.BotSetCommand[0], f"or /{BotCommands.BotSetCommand[1]} Bot's Personal Settings (Owner or Sudo Only)"),
561561
BotCommand(BotCommands.RestartCommand[0], f'or /{BotCommands.RestartCommand[1]} Restart & Update the Bot (Owner or Sudo Only)'),
562-
])
562+
]
563+
if config_dict['SHOW_EXTRA_CMDS']:
564+
bot_cmds.insert(1, BotCommand(BotCommands.MirrorCommand[2], f'or /{BotCommands.MirrorCommand[3]} Mirror and UnZip [links/media/rclone_path]'))
565+
bot_cmds.insert(1, BotCommand(BotCommands.MirrorCommand[4], f'or /{BotCommands.MirrorCommand[5]} Mirror and Zip [links/media/rclone_path]'))
566+
bot_cmds.insert(4, BotCommand(BotCommands.LeechCommand[2], f'or /{BotCommands.LeechCommand[3]} Leech and UnZip [links/media/rclone_path]'))
567+
bot_cmds.insert(4, BotCommand(BotCommands.LeechCommand[4], f'or /{BotCommands.LeechCommand[5]} Leech and Zip [links/media/rclone_path]'))
568+
bot_cmds.insert(7, BotCommand(BotCommands.QbMirrorCommand[2], f'or /{BotCommands.QbMirrorCommand[3]} Mirror magnet/torrent and UnZip using qBit'))
569+
bot_cmds.insert(7, BotCommand(BotCommands.QbMirrorCommand[4], f'or /{BotCommands.QbMirrorCommand[5]} Mirror magnet/torrent and Zip using qBit'))
570+
bot_cmds.insert(10, BotCommand(BotCommands.QbLeechCommand[2], f'or /{BotCommands.QbLeechCommand[3]} Leech magnet/torrent and UnZip using qBit'))
571+
bot_cmds.insert(10, BotCommand(BotCommands.QbLeechCommand[4], f'or /{BotCommands.QbLeechCommand[5]} Leech magnet/torrent and Zip using qBit'))
572+
bot_cmds.insert(13, BotCommand(BotCommands.YtdlCommand[2], f'or /{BotCommands.YtdlCommand[3]} Mirror yt-dlp supported links and Zip via bot'))
573+
bot_cmds.insert(13, BotCommand(BotCommands.YtdlLeechCommand[2], f'or /{BotCommands.YtdlLeechCommand[3]} Leech yt-dlp supported links and Zip via bot'))
574+
await client.set_bot_commands(bot_cmds)
563575
LOGGER.info('Bot Commands have been Set & Updated')
564576
except Exception as err:
565577
LOGGER.error(err)

bot/helper/ext_utils/leech_utils.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ async def format_filename(file_, user_id, dirpath=None, isMirror=False):
252252
slit = lcaption.split("|")
253253
up_path = ospath.join(dirpath, prefile_)
254254
cap_mono = slit[0].format(
255-
filename=nfile_,
256-
size=get_readable_file_size(await aiopath.getsize(up_path)),
257-
duration = get_readable_time((await get_media_info(up_path))[0])
255+
filename = nfile_,
256+
size = get_readable_file_size(await aiopath.getsize(up_path)),
257+
duration = get_readable_time((await get_media_info(up_path))[0]),
258+
md5_hash = get_md5_hash(up_path)
258259
)
259260
if len(slit) > 1:
260261
for rep in range(1, len(slit)):

bot/helper/ext_utils/task_manager.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ async def limit_checker(size, listener, isTorrent=False, isMega=False, isDriveLi
191191

192192

193193
async def task_utils(message):
194-
LOGGER.info('Checking Task Utilities ...')
194+
LOGGER.info('Running Task Manager ...')
195195
msg = []
196196
button = None
197197

198198
token_msg, button = checking_access(message.from_user.id, button)
199199
if token_msg is not None:
200200
msg.append(token_msg)
201-
if message.chat.type != message.chat.type.PRIVATE:
201+
if message.chat.type != message.chat.type.BOT:
202202
if ids := config_dict['FSUB_IDS']:
203203
_msg, button = await forcesub(message, ids, button)
204204
if _msg:
@@ -207,10 +207,9 @@ async def task_utils(message):
207207
user_dict = user_data.get(user_id, {})
208208
user = await user_info(message._client, message.from_user.id)
209209
if config_dict['BOT_PM'] or user_dict.get('bot_pm'):
210-
if user.status == user.status.LONG_AGO:
211-
_msg, button = await BotPm_check(message, button)
212-
if _msg:
213-
msg.append(_msg)
210+
_msg, button = await BotPm_check(message, button)
211+
if _msg:
212+
msg.append(_msg)
214213
if (bmax_tasks := config_dict['BOT_MAX_TASKS']) and len(download_dict) >= bmax_tasks:
215214
msg.append(f"Bot Max Tasks limit exceeded.\nBot max tasks limit is {bmax_tasks}.\nPlease wait for the completion of other tasks.")
216215
if (maxtask := config_dict['USER_MAX_TASKS']) and await get_user_tasks(message.from_user.id, maxtask):

0 commit comments

Comments
 (0)