Skip to content

Commit

Permalink
v4.8.0
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
Co-authored-by: Ncode2014 <[email protected]>
  • Loading branch information
3 people authored May 30, 2021
1 parent e679718 commit 53403b2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion aria.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
12 changes: 9 additions & 3 deletions bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions bot/modules/cancel_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions bot/modules/stickers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math
import os
import urllib.request as urllib
from PIL import Image
from html import escape
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,4 +27,3 @@ speedtest-cli
telegraph
tenacity
TgCrypto
youtube_dl

0 comments on commit 53403b2

Please sign in to comment.