File Name:
+{{file_name}}
+
File Size:
+{{file_size}}
+diff --git a/FileStream/__init__.py b/FileStream/__init__.py index 853f71e..66d212f 100644 --- a/FileStream/__init__.py +++ b/FileStream/__init__.py @@ -1,5 +1,5 @@ import time -__version__ = "1.0.1" +__version__ = "1.1.0" StartTime = time.time() diff --git a/FileStream/__main__.py b/FileStream/__main__.py index 65fb810..b010a88 100644 --- a/FileStream/__main__.py +++ b/FileStream/__main__.py @@ -3,13 +3,12 @@ import asyncio import logging import traceback import logging.handlers as handlers -from .config import Telegram, Server +from FileStream.config import Telegram, Server from aiohttp import web from pyrogram import idle from FileStream.bot import FileStream from FileStream.server import web_server -from FileStream.utils import ping_server from FileStream.bot.clients import initialize_clients logging.basicConfig( @@ -47,10 +46,6 @@ async def start_services(): print("---------------------- Initializing Clients ----------------------") await initialize_clients() print("------------------------------ DONE ------------------------------") - if Server.KEEP_ALIVE: - print("------------------ Starting Keep Alive Service ------------------") - print() - asyncio.create_task(ping_server()) print() print("--------------------- Initializing Web Server ---------------------") await server.setup() diff --git a/FileStream/bot/plugins/start.py b/FileStream/bot/plugins/start.py index 1bce6ce..b2fe645 100644 --- a/FileStream/bot/plugins/start.py +++ b/FileStream/bot/plugins/start.py @@ -20,12 +20,20 @@ async def start(bot: Client, message: Message): usr_cmd = message.text.split("_")[-1] if usr_cmd == "/start": - await message.reply_text( - text=LANG.START_TEXT.format(message.from_user.mention, FileStream.username), - parse_mode=ParseMode.HTML, - disable_web_page_preview=True, - reply_markup=BUTTON.START_BUTTONS - ) + if Telegram.START_PIC: + await message.reply_photo( + photo=Telegram.START_PIC, + caption=LANG.START_TEXT.format(message.from_user.mention, FileStream.username), + parse_mode=ParseMode.HTML, + reply_markup=BUTTON.START_BUTTONS + ) + else: + await message.reply_text( + text=LANG.START_TEXT.format(message.from_user.mention, FileStream.username), + parse_mode=ParseMode.HTML, + disable_web_page_preview=True, + reply_markup=BUTTON.START_BUTTONS + ) else: if "stream_" in message.text: try: @@ -70,23 +78,38 @@ async def start(bot: Client, message: Message): async def start(bot, message): if not await verify_user(bot, message): return - await message.reply_text( - text=LANG.ABOUT_TEXT.format(FileStream.fname, __version__), - disable_web_page_preview=True, - reply_markup=BUTTON.ABOUT_BUTTONS - ) - + if Telegram.START_PIC: + await message.reply_photo( + photo=Telegram.START_PIC, + caption=LANG.ABOUT_TEXT.format(FileStream.fname, __version__), + parse_mode=ParseMode.HTML, + reply_markup=BUTTON.ABOUT_BUTTONS + ) + else: + await message.reply_text( + text=LANG.ABOUT_TEXT.format(FileStream.fname, __version__), + disable_web_page_preview=True, + reply_markup=BUTTON.ABOUT_BUTTONS + ) @FileStream.on_message((filters.command('help')) & filters.private) async def help_handler(bot, message): if not await verify_user(bot, message): return - await message.reply_text( - text=LANG.HELP_TEXT.format(Telegram.OWNER_ID), - parse_mode=ParseMode.HTML, - disable_web_page_preview=True, - reply_markup=BUTTON.HELP_BUTTONS - ) + if Telegram.START_PIC: + await message.reply_photo( + photo=Telegram.START_PIC, + caption=LANG.HELP_TEXT.format(Telegram.OWNER_ID), + parse_mode=ParseMode.HTML, + reply_markup=BUTTON.HELP_BUTTONS + ) + else: + await message.reply_text( + text=LANG.HELP_TEXT.format(Telegram.OWNER_ID), + parse_mode=ParseMode.HTML, + disable_web_page_preview=True, + reply_markup=BUTTON.HELP_BUTTONS + ) # --------------------------------------------------------------------------------------------------- @@ -112,7 +135,7 @@ async def my_files(bot: Client, message: Message): [InlineKeyboardButton("ᴇᴍᴘᴛʏ", callback_data="N/A")], ) file_list.append([InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")]) - await message.reply_photo(photo=Telegram.IMAGE_FILEID, + await message.reply_photo(photo=Telegram.FILE_PIC, caption="Total files: {}".format(total_files), reply_markup=InlineKeyboardMarkup(file_list)) diff --git a/FileStream/bot/plugins/stream.py b/FileStream/bot/plugins/stream.py index 3a618e9..cca7e4d 100644 --- a/FileStream/bot/plugins/stream.py +++ b/FileStream/bot/plugins/stream.py @@ -48,8 +48,8 @@ async def private_receive_handler(bot: Client, message: Message): except FloodWait as e: print(f"Sleeping for {str(e.value)}s") await asyncio.sleep(e.value) - await bot.send_message(chat_id=Telegram.LOG_CHANNEL, - text=f"Gᴏᴛ FʟᴏᴏᴅWᴀɪᴛ ᴏғ {str(e.value)}s from [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**𝚄𝚜𝚎𝚛 𝙸𝙳 :** `{str(message.from_user.id)}`", + await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, + text=f"Gᴏᴛ FʟᴏᴏᴅWᴀɪᴛ ᴏғ {str(e.value)}s ғʀᴏᴍ [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**ᴜsᴇʀ ɪᴅ :** `{str(message.from_user.id)}`", disable_web_page_preview=True, parse_mode=ParseMode.MARKDOWN) @@ -86,10 +86,11 @@ async def channel_receive_handler(bot: Client, message: Message): except FloodWait as w: print(f"Sleeping for {str(w.x)}s") await asyncio.sleep(w.x) - await bot.send_message(chat_id=Telegram.LOG_CHANNEL, - text=f"ɢᴏᴛ ғʟᴏᴏᴅᴡᴀɪᴛ ᴏғ {str(w.x)}s FROM {message.chat.title}\n\n**CHANNEL ID:** `{str(message.chat.id)}`", + await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, + text=f"ɢᴏᴛ ғʟᴏᴏᴅᴡᴀɪᴛ ᴏғ {str(w.x)}s ғʀᴏᴍ {message.chat.title}\n\n**ᴄʜᴀɴɴᴇʟ ɪᴅ :** `{str(message.chat.id)}`", disable_web_page_preview=True) except Exception as e: - await bot.send_message(chat_id=Telegram.LOG_CHANNEL, text=f"**#EʀʀᴏʀTʀᴀᴄᴋᴇʙᴀᴄᴋ:** `{e}`", + await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, text=f"**#EʀʀᴏʀTʀᴀᴄᴋᴇʙᴀᴄᴋ:** `{e}`", disable_web_page_preview=True) print(f"Cᴀɴ'ᴛ Eᴅɪᴛ Bʀᴏᴀᴅᴄᴀsᴛ Mᴇssᴀɢᴇ!\nEʀʀᴏʀ: **Gɪᴠᴇ ᴍᴇ ᴇᴅɪᴛ ᴘᴇʀᴍɪssɪᴏɴ ɪɴ ᴜᴘᴅᴀᴛᴇs ᴀɴᴅ ʙɪɴ Cʜᴀɴɴᴇʟ!{e}**") + diff --git a/FileStream/config.py b/FileStream/config.py index 981f3e0..b958365 100644 --- a/FileStream/config.py +++ b/FileStream/config.py @@ -15,11 +15,12 @@ class Telegram: FORCE_UPDATES_CHANNEL = env.get('FORCE_UPDATES_CHANNEL', False) FORCE_UPDATES_CHANNEL = True if str(FORCE_UPDATES_CHANNEL).lower() == "true" else False SLEEP_THRESHOLD = int(env.get("SLEEP_THRESHOLD", "60")) - IMAGE_FILEID = env.get('IMAGE_FILEID', "https://telegra.ph/file/5bb9935be0229adf98b73.jpg") + FILE_PIC = env.get('FILE_PIC', "https://graph.org/file/5bb9935be0229adf98b73.jpg") + START_PIC = env.get('START_PIC', "https://graph.org/file/290af25276fa34fa8f0aa.jpg") + VERIFY_PIC = env.get('VERIFY_PIC', "https://graph.org/file/736e21cc0efa4d8c2a0e4.jpg") MULTI_CLIENT = False - LOG_CHANNEL = int( - env.get("BIN_CHANNEL", None) - ) # you NEED to use a CHANNEL when you're using MULTI_CLIENT + FLOG_CHANNEL = int(env.get("FLOG_CHANNEL", None)) # Logs channel for file logs + ULOG_CHANNEL = int(env.get("ULOG_CHANNEL", None)) # Logs channel for user logs MODE = env.get("MODE", "primary") SECONDARY = True if MODE.lower() == "secondary" else False AUTH_USERS = list(set(int(x) for x in str(env.get("AUTH_USERS", "")).split())) @@ -27,13 +28,13 @@ class Telegram: class Server: PORT = int(env.get("PORT", 8080)) BIND_ADDRESS = str(env.get("BIND_ADDRESS", "0.0.0.0")) - PING_INTERVAL = int(env.get("PING_INTERVAL", "1200")) # 20 minutes + PING_INTERVAL = int(env.get("PING_INTERVAL", "1200")) HAS_SSL = str(env.get("HAS_SSL", "0").lower()) in ("1", "true", "t", "yes", "y") NO_PORT = str(env.get("NO_PORT", "0").lower()) in ("1", "true", "t", "yes", "y") FQDN = str(env.get("FQDN", BIND_ADDRESS)) URL = "http{}://{}{}/".format( "s" if HAS_SSL else "", FQDN, "" if NO_PORT else ":" + str(PORT) ) - KEEP_ALIVE = str(env.get("KEEP_ALIVE", "0").lower()) in ("1", "true", "t", "yes", "y") + diff --git a/FileStream/template/dl.html b/FileStream/template/dl.html index 095d465..2dce487 100644 --- a/FileStream/template/dl.html +++ b/FileStream/template/dl.html @@ -5,24 +5,22 @@ -
{{file_name}}
{{file_size}}
+
+ This is a Telegram Bot to Stream Movies and Series directly on
+ Telegram. You can also
+ download them if you want. This bot is developed by Avi
+
If you like this bot, then don't
+ forget to share it with your friends and family.
+
Report Bugs and Contact us on Telegram Below
+