- Some modification in /start command
- Added multiple tracker
- Change to yt-dlp for more supported site (memory executed is fixed when  yt-dlp)
- Tidying up

Co-authored-by: Sreeraj V R <SVR666@users.noreply.github.com>
Co-authored-by: Ncode2014 <Ncode2014@users.noreply.github.com>
This commit is contained in:
Hafitz Setya 2021-05-30 08:34:49 +07:00 committed by GitHub
parent e67971855d
commit 53403b2df4
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 13 deletions

View File

@ -23,10 +23,12 @@
- Speedtest with picture results - Speedtest with picture results
- Limiting Torrent size support - Limiting Torrent size support
- Sudo with Database support - Sudo with Database support
- Multiple Trackers support
- Check Heroku dynos stats - Check Heroku dynos stats
- Custom image support - Custom image support
- Racaty.net support - Racaty.net support
- Shell and Executor - Shell and Executor
- Change to YT-DLP
- Stickers module - Stickers module
## From Original Repos ## From Original Repos
@ -111,7 +113,7 @@ cp config_sample.env config.env
_____REMOVE_THIS_LINE_____=True _____REMOVE_THIS_LINE_____=True
``` ```
Fill up rest of the fields. Meaning of each fields are discussed below: 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) - **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_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 - **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_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) - **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) - **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. - **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. - **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. - **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.

View File

@ -1,5 +1,5 @@
export MAX_DOWNLOAD_SPEED=0 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 export MAX_CONCURRENT_DOWNLOADS=7
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false \ aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false \

View File

@ -60,7 +60,14 @@ Type /{BotCommands.HelpCommand} to get a list of available commands
buttons.buildbutton("Repo", "https://github.com/breakdowns/slam-mirrorbot") buttons.buildbutton("Repo", "https://github.com/breakdowns/slam-mirrorbot")
buttons.buildbutton("Support Group", "https://t.me/SlamMirrorSupport") buttons.buildbutton("Support Group", "https://t.me/SlamMirrorSupport")
reply_markup = InlineKeyboardMarkup(buttons.build_menu(2)) reply_markup = InlineKeyboardMarkup(buttons.build_menu(2))
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) 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 @run_async
@ -211,8 +218,7 @@ def main():
remove('restart.pickle') remove('restart.pickle')
bot.set_my_commands(botcmds) bot.set_my_commands(botcmds)
start_handler = CommandHandler(BotCommands.StartCommand, start, start_handler = CommandHandler(BotCommands.StartCommand, start)
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
ping_handler = CommandHandler(BotCommands.PingCommand, ping, ping_handler = CommandHandler(BotCommands.PingCommand, ping,
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user) filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
restart_handler = CommandHandler(BotCommands.RestartCommand, restart, restart_handler = CommandHandler(BotCommands.RestartCommand, restart,

View File

@ -1,6 +1,6 @@
from .download_helper import DownloadHelper from .download_helper import DownloadHelper
import time import time
from youtube_dl import YoutubeDL, DownloadError from yt_dlp import YoutubeDL, DownloadError
from bot import download_dict_lock, download_dict from bot import download_dict_lock, download_dict
from ..status_utils.youtube_dl_download_status import YoutubeDLDownloadStatus from ..status_utils.youtube_dl_download_status import YoutubeDLDownloadStatus
import logging import logging

View File

@ -33,21 +33,21 @@ def cancel_mirror(update, context):
if BotCommands.MirrorCommand in update.message.text or \ if BotCommands.MirrorCommand in update.message.text or \
BotCommands.TarMirrorCommand in update.message.text or \ BotCommands.TarMirrorCommand in update.message.text or \
BotCommands.UnzipMirrorCommand in update.message.text: BotCommands.UnzipMirrorCommand in update.message.text:
msg = "Mirror Already Have Been Cancelled" msg = "Mirror already have been cancelled"
sendMessage(msg, context.bot, update) sendMessage(msg, context.bot, update)
return return
else: 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) sendMessage(msg, context.bot, update)
return return
if dl.status() == "Uploading...📤": 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 return
elif dl.status() == "Archiving...🔐": 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 return
elif dl.status() == "Extracting...📂": 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 return
else: else:
dl.download().cancel_download() dl.download().cancel_download()

View File

@ -1,4 +1,5 @@
import math import math
import os
import urllib.request as urllib import urllib.request as urllib
from PIL import Image from PIL import Image
from html import escape from html import escape

View File

@ -9,6 +9,7 @@ google-auth-httplib2
google-auth-oauthlib google-auth-oauthlib
heroku3 heroku3
html-telegraph-poster html-telegraph-poster
https://raw.githubusercontent.com/Ncode2014/nekadok/req/heroku-dlp-master.zip
js2py js2py
lxml lxml
messages messages
@ -26,4 +27,3 @@ speedtest-cli
telegraph telegraph
tenacity tenacity
TgCrypto TgCrypto
youtube_dl