diff --git a/README.md b/README.md index 8e7b9d1e0a3..3ac67f28c3d 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,12 @@ - Speedtest with picture results - Limiting Torrent size support - Sudo with Database support +- Multiple Trackers support - Check Heroku dynos stats - Custom image support - Racaty.net support - Shell and Executor +- Change to YT-DLP - Stickers module ## From Original Repos @@ -111,7 +113,7 @@ cp config_sample.env config.env _____REMOVE_THIS_LINE_____=True ``` Fill up rest of the fields. Meaning of each fields are discussed below: -### Required field +### Required Field - **BOT_TOKEN**: The Telegram bot token that you get from [@BotFather](https://t.me/BotFather) - **TELEGRAM_API**: This is to authenticate to your Telegram account for downloading Telegram files. You can get this from https://my.telegram.org DO NOT put this in quotes. - **TELEGRAM_HASH**: This is to authenticate to your Telegram account for downloading Telegram files. You can get this from https://my.telegram.org @@ -121,7 +123,7 @@ Fill up rest of the fields. Meaning of each fields are discussed below: - **DOWNLOAD_DIR**: The path to the local folder where the downloads should be downloaded to - **DOWNLOAD_STATUS_UPDATE_INTERVAL**: A short interval of time in seconds after which the Mirror progress message is updated. (I recommend to keep it `5` seconds at least) - **AUTO_DELETE_MESSAGE_DURATION**: Interval of time (in seconds), after which the bot deletes it's message (and command message) which is expected to be viewed instantly. (**Note**: Set to `-1` to never automatically delete messages) -### Optional field +### Optional Field - **AUTHORIZED_CHATS**: Fill user_id and chat_id of you want to authorize. - **IS_TEAM_DRIVE**: (Optional field) Set to `True` if `GDRIVE_FOLDER_ID` is from a Team Drive else `False` or Leave it empty. - **USE_SERVICE_ACCOUNTS**: (Optional field) (Leave empty if unsure) Whether to use Service Accounts or not. For this to work see [Using service accounts](https://github.com/breakdowns/slam-mirrorbot#generate-service-accounts-what-is-service-account) section below. diff --git a/aria.sh b/aria.sh index b498eb50858..e0ba56a2b6e 100755 --- a/aria.sh +++ b/aria.sh @@ -1,5 +1,5 @@ export MAX_DOWNLOAD_SPEED=0 -tracker_list=$(curl -Ns https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt | awk '$1' | tr '\n' ',') +tracker_list=$(curl -Ns https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt --next https://ngosang.github.io/trackerslist/trackers_all_http.txt --next https://newtrackon.com/api/all --next https://raw.githubusercontent.com/DeSireFire/animeTrackerList/master/AT_all.txt | awk '$1' | tr '\n\n' ',') export MAX_CONCURRENT_DOWNLOADS=7 aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false \ diff --git a/bot/__main__.py b/bot/__main__.py index 2b8f47e726c..7bb8a118be4 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -60,7 +60,14 @@ def start(update, context): buttons.buildbutton("Repo", "https://github.com/breakdowns/slam-mirrorbot") buttons.buildbutton("Support Group", "https://t.me/SlamMirrorSupport") reply_markup = InlineKeyboardMarkup(buttons.build_menu(2)) - update.effective_message.reply_photo(IMAGE_URL, start_string, parse_mode=ParseMode.MARKDOWN, reply_markup=reply_markup) + LOGGER.info('UID: {} - UN: {} - MSG: {}'.format(update.message.chat.id, update.message.chat.username, update.message.text)) + if CustomFilters.authorized_user(update) or CustomFilters.authorized_chat(update): + if update.message.chat.type == "private" : + sendMessage(f"Hey I'm Alive 🙂", context.bot, update) + else : + update.effective_message.reply_photo(IMAGE_URL, start_string, parse_mode=ParseMode.MARKDOWN, reply_markup=reply_markup) + else : + sendMessage(f"Oops! not a Authorized user.", context.bot, update) @run_async @@ -211,8 +218,7 @@ def main(): remove('restart.pickle') bot.set_my_commands(botcmds) - start_handler = CommandHandler(BotCommands.StartCommand, start, - filters=CustomFilters.authorized_chat | CustomFilters.authorized_user) + start_handler = CommandHandler(BotCommands.StartCommand, start) ping_handler = CommandHandler(BotCommands.PingCommand, ping, filters=CustomFilters.authorized_chat | CustomFilters.authorized_user) restart_handler = CommandHandler(BotCommands.RestartCommand, restart, diff --git a/bot/helper/mirror_utils/download_utils/youtube_dl_download_helper.py b/bot/helper/mirror_utils/download_utils/youtube_dl_download_helper.py index d590f981f35..9412bac3299 100644 --- a/bot/helper/mirror_utils/download_utils/youtube_dl_download_helper.py +++ b/bot/helper/mirror_utils/download_utils/youtube_dl_download_helper.py @@ -1,6 +1,6 @@ from .download_helper import DownloadHelper import time -from youtube_dl import YoutubeDL, DownloadError +from yt_dlp import YoutubeDL, DownloadError from bot import download_dict_lock, download_dict from ..status_utils.youtube_dl_download_status import YoutubeDLDownloadStatus import logging diff --git a/bot/modules/cancel_mirror.py b/bot/modules/cancel_mirror.py index 3a20dfca838..11729506037 100644 --- a/bot/modules/cancel_mirror.py +++ b/bot/modules/cancel_mirror.py @@ -33,21 +33,21 @@ def cancel_mirror(update, context): if BotCommands.MirrorCommand in update.message.text or \ BotCommands.TarMirrorCommand in update.message.text or \ BotCommands.UnzipMirrorCommand in update.message.text: - msg = "Mirror Already Have Been Cancelled" + msg = "Mirror already have been cancelled" sendMessage(msg, context.bot, update) return else: - msg = "Please reply to the /mirror message which was used to start the download or /cancel gid to cancel it!" + msg = f"Please reply to the /{BotCommands.MirrorCommand} message which was used to start the download or /{BotCommands.CancelMirror} GID to cancel it!" sendMessage(msg, context.bot, update) return if dl.status() == "Uploading...📤": - sendMessage("Upload in Progress, You Can't Cancel It.", context.bot, update) + sendMessage("Upload in Progress, You Can't Cancel it.", context.bot, update) return elif dl.status() == "Archiving...🔐": - sendMessage("Archival in Progress, You Can't Cancel It.", context.bot, update) + sendMessage("Archival in Progress, You Can't Cancel it.", context.bot, update) return elif dl.status() == "Extracting...📂": - sendMessage("Extract in Progress, You Can't Cancel It.", context.bot, update) + sendMessage("Extract in Progress, You Can't Cancel it.", context.bot, update) return else: dl.download().cancel_download() diff --git a/bot/modules/stickers.py b/bot/modules/stickers.py index 5d6648305a7..442a4f0a03a 100644 --- a/bot/modules/stickers.py +++ b/bot/modules/stickers.py @@ -1,4 +1,5 @@ import math +import os import urllib.request as urllib from PIL import Image from html import escape diff --git a/requirements.txt b/requirements.txt index 76e38711a2b..13028a95045 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ google-auth-httplib2 google-auth-oauthlib heroku3 html-telegraph-poster +https://raw.githubusercontent.com/Ncode2014/nekadok/req/heroku-dlp-master.zip js2py lxml messages @@ -26,4 +27,3 @@ speedtest-cli telegraph tenacity TgCrypto -youtube_dl