Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 53403b2

Browse files
breakdownsSVR666Ncode2014
authored
v4.8.0
- 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]>
1 parent e679718 commit 53403b2

File tree

7 files changed

+22
-13
lines changed

7 files changed

+22
-13
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
- Speedtest with picture results
2424
- Limiting Torrent size support
2525
- Sudo with Database support
26+
- Multiple Trackers support
2627
- Check Heroku dynos stats
2728
- Custom image support
2829
- Racaty.net support
2930
- Shell and Executor
31+
- Change to YT-DLP
3032
- Stickers module
3133

3234
## From Original Repos
@@ -111,7 +113,7 @@ cp config_sample.env config.env
111113
_____REMOVE_THIS_LINE_____=True
112114
```
113115
Fill up rest of the fields. Meaning of each fields are discussed below:
114-
### Required field
116+
### Required Field
115117
- **BOT_TOKEN**: The Telegram bot token that you get from [@BotFather](https://t.me/BotFather)
116118
- **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.
117119
- **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:
121123
- **DOWNLOAD_DIR**: The path to the local folder where the downloads should be downloaded to
122124
- **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)
123125
- **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)
124-
### Optional field
126+
### Optional Field
125127
- **AUTHORIZED_CHATS**: Fill user_id and chat_id of you want to authorize.
126128
- **IS_TEAM_DRIVE**: (Optional field) Set to `True` if `GDRIVE_FOLDER_ID` is from a Team Drive else `False` or Leave it empty.
127129
- **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.

aria.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export MAX_DOWNLOAD_SPEED=0
2-
tracker_list=$(curl -Ns https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt | awk '$1' | tr '\n' ',')
2+
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' ',')
33
export MAX_CONCURRENT_DOWNLOADS=7
44

55
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false \

bot/__main__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ def start(update, context):
6060
buttons.buildbutton("Repo", "https://github.com/breakdowns/slam-mirrorbot")
6161
buttons.buildbutton("Support Group", "https://t.me/SlamMirrorSupport")
6262
reply_markup = InlineKeyboardMarkup(buttons.build_menu(2))
63-
update.effective_message.reply_photo(IMAGE_URL, start_string, parse_mode=ParseMode.MARKDOWN, reply_markup=reply_markup)
63+
LOGGER.info('UID: {} - UN: {} - MSG: {}'.format(update.message.chat.id, update.message.chat.username, update.message.text))
64+
if CustomFilters.authorized_user(update) or CustomFilters.authorized_chat(update):
65+
if update.message.chat.type == "private" :
66+
sendMessage(f"Hey I'm Alive 🙂", context.bot, update)
67+
else :
68+
update.effective_message.reply_photo(IMAGE_URL, start_string, parse_mode=ParseMode.MARKDOWN, reply_markup=reply_markup)
69+
else :
70+
sendMessage(f"Oops! not a Authorized user.", context.bot, update)
6471

6572

6673
@run_async
@@ -211,8 +218,7 @@ def main():
211218
remove('restart.pickle')
212219
bot.set_my_commands(botcmds)
213220

214-
start_handler = CommandHandler(BotCommands.StartCommand, start,
215-
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
221+
start_handler = CommandHandler(BotCommands.StartCommand, start)
216222
ping_handler = CommandHandler(BotCommands.PingCommand, ping,
217223
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
218224
restart_handler = CommandHandler(BotCommands.RestartCommand, restart,

bot/helper/mirror_utils/download_utils/youtube_dl_download_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .download_helper import DownloadHelper
22
import time
3-
from youtube_dl import YoutubeDL, DownloadError
3+
from yt_dlp import YoutubeDL, DownloadError
44
from bot import download_dict_lock, download_dict
55
from ..status_utils.youtube_dl_download_status import YoutubeDLDownloadStatus
66
import logging

bot/modules/cancel_mirror.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ def cancel_mirror(update, context):
3333
if BotCommands.MirrorCommand in update.message.text or \
3434
BotCommands.TarMirrorCommand in update.message.text or \
3535
BotCommands.UnzipMirrorCommand in update.message.text:
36-
msg = "Mirror Already Have Been Cancelled"
36+
msg = "Mirror already have been cancelled"
3737
sendMessage(msg, context.bot, update)
3838
return
3939
else:
40-
msg = "Please reply to the /mirror message which was used to start the download or /cancel gid to cancel it!"
40+
msg = f"Please reply to the /{BotCommands.MirrorCommand} message which was used to start the download or /{BotCommands.CancelMirror} GID to cancel it!"
4141
sendMessage(msg, context.bot, update)
4242
return
4343
if dl.status() == "Uploading...📤":
44-
sendMessage("Upload in Progress, You Can't Cancel It.", context.bot, update)
44+
sendMessage("Upload in Progress, You Can't Cancel it.", context.bot, update)
4545
return
4646
elif dl.status() == "Archiving...🔐":
47-
sendMessage("Archival in Progress, You Can't Cancel It.", context.bot, update)
47+
sendMessage("Archival in Progress, You Can't Cancel it.", context.bot, update)
4848
return
4949
elif dl.status() == "Extracting...📂":
50-
sendMessage("Extract in Progress, You Can't Cancel It.", context.bot, update)
50+
sendMessage("Extract in Progress, You Can't Cancel it.", context.bot, update)
5151
return
5252
else:
5353
dl.download().cancel_download()

bot/modules/stickers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import math
2+
import os
23
import urllib.request as urllib
34
from PIL import Image
45
from html import escape

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ google-auth-httplib2
99
google-auth-oauthlib
1010
heroku3
1111
html-telegraph-poster
12+
https://raw.githubusercontent.com/Ncode2014/nekadok/req/heroku-dlp-master.zip
1213
js2py
1314
lxml
1415
messages
@@ -26,4 +27,3 @@ speedtest-cli
2627
telegraph
2728
tenacity
2829
TgCrypto
29-
youtube_dl

0 commit comments

Comments
 (0)