Skip to content

Commit cf215a5

Browse files
committed
Feat: New Features & Improvements
Changelog (redeploy needed) -> 1. Switched to kurigram 2. Fixed mega download, remove mega clone 3. Added swap mt 4. Fixed gensession, quickinfo 5. AI based nsfw detection 6. Added lot of small tools ( /tool ) inspired by https://t.me/SmartUtilBot 7. File to Link/Streaming service (alpha) 8. Reduce ytdlp memory usage 9. Sync with base 10. bug fixes
1 parent 235e88d commit cf215a5

File tree

168 files changed

+54879
-9806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+54879
-9806
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
- name: Prepare Docker Build Files
5252
run: |
5353
cp dev/Aeon .
54-
cp dev/megasdk-4.8.0-py2.py3-none-any.whl .
5554
chmod +x Aeon
5655
5756
- name: Build and Push

.github/workflows/deploy.yml

Lines changed: 240 additions & 33 deletions
Large diffs are not rendered by default.

.github/workflows/ruff_format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: format code with ruff
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [extended]
66

77
jobs:
88
code-format:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ list_drives.txt
1616
shorteners.txt
1717
cookies.txt
1818
cookies/*
19-
venv/
2019
downloads/*
2120
*.session
2221
venv/

bot/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,6 @@ def is_qbittorrent_running():
335335

336336

337337
scheduler = AsyncIOScheduler(event_loop=bot_loop)
338+
339+
# Initialize streaming server
340+
StartTime = time_func()

bot/__main__.py

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"ZotifyLeechCommand": "- Leech music from Spotify",
3636
"ZotifySearchCommand": "- Search music on Spotify",
3737
"CloneCommand": "- Copy file/folder to Drive",
38-
"MegaCloneCommand": "- Clone MEGA files/folders to MEGA account",
3938
"MegaSearchCommand": "- Search MEGA drive for files/folders",
4039
"MediaInfoCommand": "- Get mediainfo",
4140
"SoxCommand": "- Get audio spectrum",
@@ -51,19 +50,35 @@
5150
"CancelAllCommand": "- Cancel all tasks added by you to the bot",
5251
"HelpCommand": "- Get detailed help",
5352
"FontStylesCommand": "- View available font styles for leech",
54-
"IMDBCommand": "- Search for movies or TV series info",
5553
"MediaSearchCommand": "- Search for media files (/mds) or reply to a message",
5654
"SpeedTest": "- Get speedtest result",
5755
"GenSessionCommand": "- Generate Pyrogram session string",
58-
"TruecallerCommand": "- Lookup phone numbers using Truecaller",
5956
"VirusTotalCommand": "- Scan files or URLs for viruses using VirusTotal",
6057
# QuickInfo Commands
6158
"QuickInfoCommand": "- Get chat/user information with interactive buttons",
59+
# File-to-Link Commands
60+
"File2LinkCommand": "- Convert files to permanent download/stream links",
61+
"StreamStatsCommand": "- View streaming server statistics",
62+
"ToolCommand": "- Media conversion and processing tools (gif, sticker, emoji, voice, etc.)",
63+
"IndexCommand": "- [ADMIN] Reindex media files from dump chats",
6264
"BotSetCommand": "- [ADMIN] Open Bot settings",
6365
"LogCommand": "- [ADMIN] View log",
6466
"RestartCommand": "- [ADMIN] Restart the bot",
67+
"WhisperCommand": "- Send private whisper messages in group chats",
6568
}
6669

70+
# Add AI command if enabled
71+
if Config.AI_ENABLED:
72+
COMMANDS["AskCommand"] = "- Ask AI questions and get intelligent responses"
73+
74+
# Add IMDB command if enabled
75+
if Config.IMDB_ENABLED:
76+
COMMANDS["IMDBCommand"] = "- Search for movies or TV series info"
77+
78+
# Add Truecaller command if enabled
79+
if Config.TRUECALLER_ENABLED:
80+
COMMANDS["TruecallerCommand"] = "- Lookup phone numbers using Truecaller"
81+
6782
# Add encoding/decoding commands if enabled
6883
if Config.ENCODING_ENABLED:
6984
COMMANDS["EncodeCommand"] = "- Encode text using various methods"
@@ -187,6 +202,29 @@ async def main():
187202
LOGGER.info("Loading user data for limits tracking...")
188203
await _load_user_data()
189204

205+
# Streaming functionality is now fully integrated with wserver
206+
# No separate stream server needed
207+
LOGGER.info("Streaming functionality integrated with wserver")
208+
209+
# Initialize File-to-Link functionality if enabled
210+
if Config.FILE_TO_LINK_ENABLED:
211+
from .modules.file_to_link import initialize_file_to_link
212+
213+
LOGGER.info("Initializing File-to-Link functionality...")
214+
create_task(initialize_file_to_link()) # noqa: RUF006
215+
216+
# Initialize whisper cleanup task
217+
LOGGER.info("Initializing whisper cleanup task...")
218+
from .modules.whisper import start_whisper_cleanup
219+
220+
create_task(start_whisper_cleanup()) # noqa: RUF006
221+
222+
# Run automatic indexing to sync dump chats with database on startup
223+
LOGGER.info("Starting automatic indexing to sync dump chats with database...")
224+
from .modules.index_command import auto_index_on_startup
225+
226+
create_task(auto_index_on_startup()) # noqa: RUF006
227+
190228
# Initial garbage collection and memory usage logging (less aggressive during startup)
191229
LOGGER.info("Performing initial garbage collection...")
192230
smart_garbage_collection(
@@ -234,6 +272,9 @@ async def cleanup():
234272
except Exception as e:
235273
LOGGER.error(f"Error during streamrip cleanup: {e}")
236274

275+
# Streaming functionality is integrated with wserver - no separate cleanup needed
276+
LOGGER.info("Streaming functionality cleanup handled by wserver")
277+
237278
# Stop database heartbeat task
238279
await database.stop_heartbeat()
239280

@@ -273,6 +314,11 @@ def handle_loop_exception(loop, context):
273314
LOGGER.debug(
274315
f"Transport closing error (harmless during shutdown): {exception}"
275316
)
317+
# Filter out QueryIdInvalid errors from YT-DLP callback queries (these are expected when callbacks expire)
318+
elif "QUERY_ID_INVALID" in str(exception) or "QueryIdInvalid" in str(
319+
type(exception).__name__
320+
):
321+
LOGGER.debug(f"Callback query expired (expected behavior): {exception}")
276322
else:
277323
LOGGER.error(f"Unhandled loop exception: {exception}")
278324
LOGGER.error(f"Exception context: {context}")

bot/core/aeon_client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def start_bot(cls):
3131
bot_token=Config.BOT_TOKEN,
3232
workdir="/usr/src/app",
3333
parse_mode=enums.ParseMode.HTML,
34-
max_concurrent_transmissions=10,
34+
max_concurrent_transmissions=100,
3535
no_updates=False, # Ensure updates are enabled
3636
)
3737
try:
@@ -68,7 +68,7 @@ async def start_user(cls):
6868
session_string=Config.USER_SESSION_STRING,
6969
parse_mode=enums.ParseMode.HTML,
7070
no_updates=True,
71-
max_concurrent_transmissions=10,
71+
max_concurrent_transmissions=100,
7272
)
7373
await cls.user.start()
7474
cls.IS_PREMIUM_USER = cls.user.me.is_premium
@@ -119,11 +119,10 @@ async def start_hclient(cls, no, b_token):
119119
@classmethod
120120
async def start_helper_bots(cls):
121121
if not Config.HELPER_TOKENS:
122-
LOGGER.info(
123-
"No HELPER_TOKENS found, hyper download will not be available"
122+
LOGGER.warning(
123+
"No HELPER_TOKENS found, hyper download will not be available"
124124
)
125125
return
126-
LOGGER.info("Generating helper clients from HELPER_TOKENS")
127126
async with cls._hlock:
128127
await gather(
129128
*(

0 commit comments

Comments
 (0)