Skip to content
Open

Yato #69

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2413830
Update bot configuration parameters
Im-Sourav02 Mar 4, 2026
830e499
Implement custom domain redirection in shortner
Im-Sourav02 Apr 17, 2026
e617117
Update premium purchase links and transfer link logic
Im-Sourav02 Apr 17, 2026
56c8790
Update bot token and fix reply message typo
Im-Sourav02 Apr 17, 2026
020f1c2
Add pip install command to Dockerfile
Im-Sourav02 Apr 17, 2026
ecad386
Update config.py
Im-Sourav02 Apr 17, 2026
5e5d78a
Update config.py
souravagarwal2007 May 26, 2026
679f2cc
Update config.py
souravagarwal2007 May 26, 2026
bcd62e6
Update premium upgrade button URL
souravagarwal2007 May 26, 2026
7cc2e17
Update config.py
souravagarwal2007 May 26, 2026
70708f6
Update start.py
souravagarwal2007 May 26, 2026
ef3d238
Enhance caption processing for video messages
souravagarwal2007 May 26, 2026
84a3326
Update caption formatting for video and document messages
souravagarwal2007 May 26, 2026
952310c
Enhance channel_post with video quality handling
souravagarwal2007 May 26, 2026
227aa6e
Implement toggle button for get files feature
souravagarwal2007 May 26, 2026
10512de
Update helper_func.py
souravagarwal2007 May 26, 2026
cdeed3c
Refactor channel_post.py for improved readability
souravagarwal2007 May 26, 2026
51d0e44
Merge pull request #1 from souravagarwal2007/Yato
Im-Sourav02 Jun 27, 2026
35d4a78
Change bot token in config.py
Im-Sourav02 Jun 27, 2026
2a31d3f
Update DB_CHANNEL to new channel ID
Im-Sourav02 Jun 27, 2026
93a3c73
Added Auto-Watermark
Im-Sourav02 Jun 27, 2026
1ac6635
Added Auto-Watermark
Im-Sourav02 Jun 27, 2026
a681d98
Restore Auto Watermark Feature and Fix Channel Post
Im-Sourav02 Jun 27, 2026
d0d846e
Changed the token
Im-Sourav02 Jun 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REDIRECTOR_DOMAIN=sukuna.site
ENCRYPTION_KEY=e2d7c581a9f032b4c6e917d84b2c1f3a5e8d9b0a1f2c3d4e5f6a7b8c9d0e1f2a
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM python:3.10

WORKDIR /app

COPY . .

RUN pip install --no-cache-dir -r requirements.txt

RUN chmod +x start.sh

CMD ["bash", "start.sh"]
178 changes: 178 additions & 0 deletions bot.log

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ async def start(self):
self.tutorial_link = SHORT_TUT
self.shortner_enabled = True

# Load bot settings
try:
self.auto_watermark = await self.mongodb.get_bot_setting('auto_watermark', True)
except Exception as e:
self.LOGGER(__name__, self.name).warning(f"Error loading bot settings: {e}")
self.auto_watermark = True

try:
db_channel = await self.get_chat(self.db)
self.db_channel = db_channel
Expand Down
38 changes: 19 additions & 19 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@

# Bot Configuration
LOG_FILE_NAME = "bot.log"
PORT = '5010'
OWNER_ID = 6497757690
PORT = 5010
OWNER_ID = 6123108288

MSG_EFFECT = 5046509860389126442

SHORT_URL = "linkshortify.com" # shortner url
SHORT_API = ""
SHORT_TUT = "https://t.me/How_to_Download_7x/26"
SHORT_API = "573350da0e10a5a44f7e6fec3bc2b3f836b47805"
SHORT_TUT = "https://t.me/Infinix_Tutorial/10"

# Bot Configuration
SESSION = "yato"
TOKEN = "642712"
API_ID = ""
API_HASH = ""
TOKEN = "7751221792:AAERWAIjUrhiEIVW-mWzF6v7l3dBLNrez14"
API_ID = "21446955"
API_HASH = "e6f34a6186963663342b88b88c2b4750"
WORKERS = 5

DB_URI = "mongodb"
DB_NAME = "yato"
DB_URI = "mongodb+srv://souravagarwal14092007:szXRs8g7fErCnn4@cluster0.xlsbf3o.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
DB_NAME = "Cluster0"

FSUBS = [[-1003016571084, True, 10]] # Force Subscription Channels [channel_id, request_enabled, timer_in_minutes]
FSUBS = [] # Temporarily disabled so bot can run locally without being an admin in the channel
# Database Channel (Primary)
DB_CHANNEL = # just put channel id dont add ""
DB_CHANNEL = -1002558171315 # just put channel id dont add ""
# Multiple Database Channels (can be set via bot settings)
# DB_CHANNELS = {
# "-1002595092736": {"name": "Primary DB", "is_primary": True, "is_active": True},
Expand All @@ -33,22 +33,22 @@
# Auto Delete Timer (seconds)
AUTO_DEL = 300
# Admin IDs
ADMINS = [6497757690, 6103092779]
ADMINS = [6123108288]
# Bot Settings
DISABLE_BTN = True
PROTECT = True

# Messages Configuration
MESSAGES = {
"START": "<b>›› ʜᴇʏ!!, {first} ~ <blockquote>ʟᴏᴠᴇ ᴘᴏʀɴʜᴡᴀ? ɪ ᴀᴍ ᴍᴀᴅᴇ ᴛᴏ ʜᴇʟᴘ ʏᴏᴜ ᴛᴏ ғɪɴᴅ ᴡʜᴀᴛ ʏᴏᴜ aʀᴇ ʟᴏᴏᴋɪɴɢ ꜰᴏʀ.</blockquote></b>",
"START": "<b>›› ʜᴇʏ!!, {first} ~ <blockquote>ʟᴏᴠᴇ ᴘᴏʀɴ? ɪ ᴀᴍ ᴍᴀᴅᴇ ᴛᴏ ʜᴇʟᴘ ʏᴏᴜ ᴛᴏ ғɪɴᴅ ᴡʜᴀᴛ ʏᴏᴜ aʀᴇ ʟᴏᴏᴋɪɴɢ ꜰᴏʀ.</blockquote></b>",
"FSUB": "<b><blockquote>›› ʜᴇʏ ×</blockquote>\n ʏᴏᴜʀ ғɪʟᴇ ɪs ʀᴇᴀᴅʏ ‼️ ʟᴏᴏᴋs ʟɪᴋᴇ ʏᴏᴜ ʜᴀᴠᴇɴ'ᴛ sᴜʙsᴄʀɪʙᴇᴅ ᴛᴏ ᴏᴜʀ ᴄʜᴀɴɴᴇʟs ʏᴇᴛ, sᴜʙsᴄʀɪʙᴇ ɴᴏᴡ ᴛᴏ ɢᴇᴛ ʏᴏᴜʀ ғɪʟᴇs</b>",
"ABOUT": "<b>›› ғᴏʀ ᴍᴏʀᴇ: @Nova_Flix \n <blockquote expandable>›› ᴜᴘᴅᴀᴛᴇs ᴄʜᴀɴɴᴇʟ: <a href='https://t.me/codeflix_bots'>Cʟɪᴄᴋ ʜᴇʀᴇ</a> \n›› ᴏᴡɴᴇʀ: @ProYato\n›› ʟᴀɴɢᴜᴀɢᴇ: <a href='https://docs.python.org/3/'>Pʏᴛʜᴏɴ 3</a> \n›› ʟɪʙʀᴀʀʏ: <a href='https://docs.pyrogram.org/'>Pʏʀᴏɢʀᴀᴍ ᴠ2</a> \n›› ᴅᴀᴛᴀʙᴀsᴇ: <a href='https://www.mongodb.com/docs/'>Mᴏɴɢᴏ ᴅʙ</a> \n›› ᴅᴇᴠᴇʟᴏᴘᴇʀ: @cosmic_freak</b></blockquote>",
"REPLY": "<b>For More Join - @Hanime_Arena</b>",
"ABOUT": "<b><blockquote>◈ ᴏᴡɴᴇʀ : <a href=t.me/Im_Sukuna02>ɪᴍ•Ꮪᴜ͢ᴋᴜɴᴀ</a>\n◈ ꜰᴏᴜɴᴅᴇʀ ᴏꜰ : <a href=https://t.me/InfinixSyndicate>ɪɴғɪɴɪx sʏɴᴅɪᴄᴀᴛᴇ</a>\n◈ ᴍᴏᴠɪᴇs ᴄʜᴀɴɴᴇʟ : <a href=https://t.me/Infinix_Movie>ɪɴғɪɴɪx ᴍᴏᴠɪᴇs</a>\n◈ ᴅᴇᴠᴇʟᴏᴘᴇʀ : <a href=https://t.me/Im_Sukuna02>Sᴜᴋᴜɴᴀ</a></blockquote></b>",
"REPLY": "<b>For More Join - @Infinix_Adult</b>",
"SHORT_MSG": "<b>📊 ʜᴇʏ {first}, \n\n‼️ ɢᴇᴛ ᴀʟʟ ꜰɪʟᴇꜱ ɪɴ ᴀ ꜱɪɴɢʟᴇ ʟɪɴᴋ ‼️\n\n ⌯ ʏᴏᴜʀ ʟɪɴᴋ ɪꜱ ʀᴇᴀᴅʏ, ᴋɪɴᴅʟʏ ᴄʟɪᴄᴋ ᴏɴ ᴏᴘᴇɴ ʟɪɴᴋ ʙᴜᴛᴛᴏɴ..</b>",
"START_PHOTO": "https://graph.org/file/510affa3d4b6c911c12e3.jpg",
"FSUB_PHOTO": "https://telegra.ph/file/7a16ef7abae23bd238c82-b8fbdcb05422d71974.jpg",
"SHORT_PIC": "https://telegra.ph/file/7a16ef7abae23bd238c82-b8fbdcb05422d71974.jpg",
"SHORT": "https://telegra.ph/file/8aaf4df8c138c6685dcee-05d3b183d4978ec347.jpg"
"START_PHOTO": "https://i.ibb.co/GvJsGpyL/x.jpg",
"FSUB_PHOTO": "https://i.ibb.co/GvJsGpyL/x.jpg",
"SHORT_PIC": "https://i.ibb.co/GvJsGpyL/x.jpg",
"SHORT": "https://i.ibb.co/GvJsGpyL/x.jpg"
}

def LOGGER(name: str, client_name: str) -> logging.Logger:
Expand Down
2 changes: 1 addition & 1 deletion helper/helper_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ async def batch_auto_del_notification(bot_username, messages, delay_time, transf

# Update notification with get files button
try:
if transfer_link:
if transfer_link and getattr(client, 'get_files_btn', True):
try:
name = "• ɢᴇᴛ ғɪʟᴇs •"
link = f"https://t.me/{bot_username}?start={transfer_link}"
Expand Down
5 changes: 1 addition & 4 deletions plugins/channel_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.errors import FloodWait
from helper.helper_func import encode

import re
#===============================================================#

@Client.on_message(filters.private & ~filters.command(['start', 'shortner','users','broadcast','batch','genlink','stats', 'pbroadcast', 'db', 'adddb', 'add_db', 'removedb', 'rm_db', 'ban', 'unban', 'addpremium', 'delpremium', 'premiumusers', 'request', 'profile']))
Expand Down Expand Up @@ -54,6 +54,3 @@ async def new_post(client: Client, message: Message):
pass





20 changes: 20 additions & 0 deletions plugins/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ async def settings_page_2(client, query):
›› **ᴀᴜᴛᴏ ᴅᴇʟᴇᴛᴇ ᴛɪᴍᴇʀ:** `{client.auto_del}`
›› **ᴘʀᴏᴛᴇᴄᴛ ᴄᴏɴᴛᴇɴᴛ:** `{"✓ ᴛʀᴜᴇ" if client.protect else "✗ ꜰᴀʟsᴇ"}`
›› **ᴅɪsᴀʙʟᴇ ʙᴜᴛᴛᴏɴ:** `{"✓ ᴛʀᴜᴇ" if client.disable_btn else "✗ ꜰᴀʟsᴇ"}`
›› **ᴀᴜᴛᴏ ᴡᴀᴛᴇʀᴍᴀʀᴋ:** `{"✓ ᴛʀᴜᴇ" if getattr(client, 'auto_watermark', True) else "✗ ꜰᴀʟsᴇ"}`
›› **ɢᴇᴛ ꜰɪʟᴇs ʙᴛɴ:** `{"✓ ᴛʀᴜᴇ" if getattr(client, 'get_files_btn', True) else "✗ ꜰᴀʟsᴇ"}`
›› **ʀᴇᴘʟʏ ᴛᴇxᴛ:** `{client.reply_text if client.reply_text else 'ɴᴏɴᴇ'}`
›› **ᴀᴅᴍɪɴs:** `{len(client.admins)}`
›› **sʜᴏʀᴛɴᴇʀ ᴜʀʟ:** `{getattr(client, 'short_url', 'ɴᴏᴛ sᴇᴛ')}`
Expand All @@ -83,6 +85,7 @@ async def settings_page_2(client, query):
reply_markup = InlineKeyboardMarkup([
[InlineKeyboardButton('ᴘʀᴏᴛᴇᴄᴛ ᴄᴏɴᴛᴇɴᴛ', 'protect'), InlineKeyboardButton('ᴘʜᴏᴛᴏs', 'photos')],
[InlineKeyboardButton('ᴛᴇxᴛs', 'texts'), InlineKeyboardButton('sʜᴏʀᴛɴᴇʀ', 'shortner')],
[InlineKeyboardButton('ᴀᴜᴛᴏ ᴡᴀᴛᴇʀᴍᴀʀᴋ', 'toggle_watermark'), InlineKeyboardButton('ɢᴇᴛ ꜰɪʟᴇs ʙᴛɴ', 'toggle_get_files')],
[InlineKeyboardButton('‹ ᴘʀᴇᴠ', 'settings'), InlineKeyboardButton('ʜᴏᴍᴇ', 'home')]
])
await query.message.edit_text(msg, reply_markup=reply_markup)
Expand Down Expand Up @@ -474,6 +477,23 @@ async def protect(client, query):

#===============================================================#

@Client.on_callback_query(filters.regex("^toggle_get_files$"))
async def toggle_get_files(client, query):
current = getattr(client, 'get_files_btn', True)
client.get_files_btn = not current
return await settings_page_2(client, query)

#===============================================================#

@Client.on_callback_query(filters.regex("^toggle_watermark$"))
async def toggle_watermark(client, query):
current = getattr(client, 'auto_watermark', True)
client.auto_watermark = not current
await client.mongodb.update_bot_setting('auto_watermark', client.auto_watermark)
return await settings_page_2(client, query)

#===============================================================#

@Client.on_callback_query(filters.regex("^auto_del$"))
async def auto_del(client, query):
msg = f"""<blockquote>**Change Auto Delete Time:**</blockquote>
Expand Down
19 changes: 16 additions & 3 deletions plugins/shortner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests
import random
import string
import base64
from config import SHORT_URL, SHORT_API, MESSAGES
from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery, InputMediaPhoto
Expand Down Expand Up @@ -36,9 +37,21 @@ def get_short(url, client):
rjson = response.json()

if rjson.get("status") == "success" and response.status_code == 200:
short_url = rjson.get("shortenedUrl", url)
shortened_urls_cache[url] = short_url
return short_url
# Get the original shortener link (lksfy.com)
original_short_link = rjson.get("shortenedUrl", url)

# --- CUSTOM DOMAIN REDIRECT LOGIC ---
# 1. Encode the lksfy link to Base64
encoded_link = base64.b64encode(original_short_link.encode("utf-8")).decode("utf-8")

# 2. Build the new sukuna.site link
secure_domain_link = f"https://sukuna.site/?to={encoded_link}"

# 3. Save to cache and return the new custom domain link
shortened_urls_cache[url] = secure_domain_link
return secure_domain_link
# ------------------------------------

except Exception as e:
print(f"[Shortener Error] {e}")

Expand Down
26 changes: 15 additions & 11 deletions plugins/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from plugins.shortner import get_short
from helper.helper_func import get_messages, force_sub, decode, batch_auto_del_notification
import asyncio
import re

#===============================================================#

Expand Down Expand Up @@ -69,7 +70,7 @@ async def start_command(client: Client, message: Message):
InlineKeyboardButton("ᴛᴜᴛᴏʀɪᴀʟ •", url=tutorial_link)
],
[
InlineKeyboardButton(" • ʙᴜʏ ᴘʀᴇᴍɪᴜᴍ •", url="https://t.me/Premium_Fliix/21")
InlineKeyboardButton(" • ʙᴜʏ ᴘʀᴇᴍɪᴜᴍ •", url="https://t.me/Infinix_Adult/27")
]
])
)
Expand Down Expand Up @@ -161,7 +162,7 @@ async def start_command(client: Client, message: Message):
return await message.reply("⚠️ Invalid or expired link.")

# 7. Get messages from the specific source channel first
temp_msg = await message.reply("Wait A Sec..")
temp_msg = await message.reply("")
messages = []

try:
Expand Down Expand Up @@ -206,12 +207,15 @@ async def start_command(client: Client, message: Message):

yugen_msgs = []
for msg in messages:
caption = (
client.messages.get('CAPTION', '').format(
previouscaption=msg.caption.html if msg.caption else msg.document.file_name
) if bool(client.messages.get('CAPTION', '')) and bool(msg.document)
else ("" if not msg.caption else msg.caption.html)
)
if getattr(client, 'auto_watermark', True):
caption = (
client.messages.get('CAPTION', '').format(
previouscaption=msg.caption.html if msg.caption else msg.document.file_name
) if bool(client.messages.get('CAPTION', '')) and bool(msg.document)
else ("" if not msg.caption else msg.caption.html)
)
else:
caption = "" if not msg.caption else msg.caption.html
reply_markup = msg.reply_markup if not client.disable_btn else None

try:
Expand All @@ -237,8 +241,8 @@ async def start_command(client: Client, message: Message):

# 8. Auto delete timer
if messages and client.auto_del > 0:
# Create transfer link for getting files again (original base64_string)
transfer_link = original_payload
# Create transfer link with the raw base64 string to force the shortener ad again
transfer_link = base64_string

# Start batch auto delete notification - single notification for all files
asyncio.create_task(batch_auto_del_notification(
Expand Down Expand Up @@ -296,7 +300,7 @@ async def request_command(client: Client, message: Message):
return

if not is_user_premium:
BUTTON_URL = "https://t.me/hanime_arena/5"
BUTTON_URL = "https://t.me/Infinix_Adult/27"
reply_markup = InlineKeyboardMarkup([
[InlineKeyboardButton("💎 Upgrade to Premium", url=BUTTON_URL)]
])
Expand Down
Binary file added yato.session
Binary file not shown.