Tidying up & Add credits for Anas

This commit is contained in:
Hafitz Setya 2021-06-08 06:38:26 +07:00 committed by GitHub
parent 5ec9688b12
commit ea8e2299ec
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 26 deletions

View File

@ -17,9 +17,10 @@
# Features supported:
## Additional Features
- Get detailed info about replied media
- Get detailed info about replied media (Only for Telegram file)
- Nyaa.si and Sukebei Torrent search
- Speedtest with picture results
- Limiting cloning Google Drive support
- Limiting Torrent size support
- Sudo with Database support
- Multiple Trackers support
@ -31,13 +32,13 @@
- View Link button (Not all Index support, recommended using [Bhadoo Index](https://github.com/ParveenBhadooOfficial/Google-Drive-Index))
- Direct links supported:
```
Racaty, Hxfile, Anonfiles, Femax20, Layarkacaxxi,
Onedrive (Only works for file not folder and busines)
Racaty, Hxfile, Anonfiles, Fembed, Femax20, Layarkacaxxi,
Uptobox (Uptobox account must be premium),
Onedrive (Only works for file not folder or busines account)
```
## From Original Repos
- Mirroring direct download links, Torrent, and Telegram files to Google Drive
- Mirroring Mega.nz links to Google Drive (If your Mega account not premium, it will limit 4-5gb/day)
- Mirroring Uptobox.com links to Google Drive (Uptobox account must be premium)
- Copy files from someone's Drive to your Drive (Using Autorclone)
- Download/Upload progress, Speeds and ETAs
- Mirror all Youtube-dl supported links
@ -138,6 +139,7 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **BLOCK_MEGA_FOLDER**: (Optional field) If you want to remove mega.nz folder support, set it to `True`.
- **BLOCK_MEGA_LINKS**: (Optional field) If you want to remove mega.nz mirror support, set it to `True`.
- **STOP_DUPLICATE_MIRROR**: (Optional field) (Leave empty if unsure) if this field is set to `True`, bot will check file in drive, if it is present in Drive, downloading will be stopped. (**Note**: File will be checked using filename, not using filehash, so this feature is not perfect yet)
- **CLONE_LIMIT**: To limit cloning Google Drive (leave space between number and unit (tb or gb only)), examples: if you fill `1 gb` it will limit `1gb`.
- **ENABLE_FILESIZE_LIMIT**: Set it to `True` if you want to use `MAX_TORRENT_SIZE`.
- **MAX_TORRENT_SIZE**: To limit the Torrent mirror size, Fill The amount you want to limit, examples: if you fill `15` it will limit `15gb`.
- **IMAGE_URL**: (Optional field) Show Image/Logo in /start message. Fill value of image your link image, use telegra.ph or any direct link image.
@ -289,5 +291,6 @@ Thanks to:
- [Dank-del](https://github.com/Dank-del/) for base repo
- [magneto261290](https://github.com/magneto261290/) for some features
- [SVR666](https://github.com/SVR666/) for some features & fixes
- [anasty17](https://github.com/anasty17) for some features & help
And many more people who aren't mentioned here, but may be found in [Contributors](https://github.com/breakdowns/slam-mirrorbot/graphs/contributors).

View File

@ -104,10 +104,14 @@
"required": false
},
"MAX_TORRENT_SIZE": {
"description": "To limit the torrent mirror size, Fill The amount you want to limit, examples: if you fill 15 it will limit 15gb.",
"description": "To limit the Torrent mirror size, Fill The amount you want to limit, examples: if you fill 15 it will limit 15gb.",
"value": "15",
"required": false
},
"CLONE_LIMIT": {
"description": "To limit cloning Google Drive (leave space between number and unit (tb or gb only)), examples: if you fill 1 gb it will limit 1gb.",
"required": false
},
"STOP_DUPLICATE_MIRROR": {
"description": "If this field is set to True, bot will check file in drive, if it is present in drive, downloading will be stopped.",
"required": false

View File

@ -129,11 +129,10 @@ app = Client(':memory:', api_id=int(TELEGRAM_API), api_hash=TELEGRAM_HASH, bot_t
#Generate Telegraph Token
sname = ''.join(random.SystemRandom().choices(string.ascii_letters, k=8))
LOGGER.info("Generating Telegraph Token using '" + sname + "' name")
LOGGER.info("Generating TELEGRAPH_TOKEN using '" + sname + "' name")
telegraph = Telegraph()
telegraph.create_account(short_name=sname)
telegraph_token = telegraph.get_access_token()
LOGGER.info("Telegraph Token Generated: '" + telegraph_token + "'")
try:
MEGA_API_KEY = getConfig('MEGA_API_KEY')

View File

@ -141,7 +141,7 @@ def bot_help(update, context):
/shell: Run commands in Shell (Terminal).
/mediainfo: Get detailed info about replied media.
/mediainfo: Get detailed info about replied media (Only for Telegram file).
/tshelp: Get help for Torrent search module.
@ -177,7 +177,7 @@ def bot_help(update, context):
/{BotCommands.SpeedCommand}: Check Internet Speed of the Host
/mediainfo: Get detailed info about replied media.
/mediainfo: Get detailed info about replied media (Only for Telegram file).
/tshelp: Get help for Torrent search module.

View File

@ -332,9 +332,9 @@ class GoogleDriveHelper:
dir_id = self.create_directory(meta.get('name'), parent_id)
result = self.cloneFolder(meta.get('name'), meta.get('name'), meta.get('id'), dir_id)
msg += f'<b>Filename: </b><code>{meta.get("name")}</code>\n<b>Size: </b><code>{get_readable_file_size(self.transferred_size)}</code>'
msg += f'\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{self.total_folders}'
msg += f'\n<b>Files: </b>{self.total_files}'
msg += f'\n<b>Type: </b><code>Folder</code>'
msg += f'\n<b>SubFolders: </b><code>{self.total_folders}</code>'
msg += f'\n<b>Files: </b><code>{self.total_files}</code>'
durl = self.__G_DRIVE_DIR_BASE_DOWNLOAD_URL.format(dir_id)
buttons = button_build.ButtonMaker()
if SHORTENER is not None and SHORTENER_API is not None:
@ -372,7 +372,7 @@ class GoogleDriveHelper:
typeee = 'File'
try:
msg += f'\n<b>Size: </b><code>{get_readable_file_size(int(meta.get("size")))}</code>'
msg += f'\n<b>Type: </b>{typeee}'
msg += f'\n<b>Type: </b><code>{typeee}</code>'
except TypeError:
pass
if INDEX_URL is not None:
@ -630,10 +630,10 @@ class GoogleDriveHelper:
if drive_file['mimeType'] == self.__G_DRIVE_DIR_MIME_TYPE:
self.gDrive_directory(**drive_file)
msg += f'<b>Filename: </b><code>{name}</code>'
msg += f'\n<b>Size: </b>{get_readable_file_size(self.total_bytes)}'
msg += f'\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{self.total_folders}'
msg += f'\n<b>Files: </b>{self.total_files}'
msg += f'\n<b>Size: </b><code>{get_readable_file_size(self.total_bytes)}</code>'
msg += f'\n<b>Type: </b><code>Folder</code>'
msg += f'\n<b>SubFolders: </b><code>{self.total_folders}</code>'
msg += f'\n<b>Files: </b><code>{self.total_files}</code>'
clonesizelimit = self.total_bytes
else:
msg += f'<b>Filename: </b><code>{name}</code>'
@ -645,8 +645,8 @@ class GoogleDriveHelper:
self.total_files += 1
self.gDrive_file(**drive_file)
msg += f'\n<b>Size: </b><code>{get_readable_file_size(self.total_bytes)}</code>'
msg += f'\n<b>Type: </b>{typee}'
msg += f'\n<b>Files: </b>{self.total_files}'
msg += f'\n<b>Type: </b><code>{typee}</code>'
msg += f'\n<b>Files: </b><code>{self.total_files}</code>'
clonesizelimit = self.total_bytes
except TypeError:
pass

View File

@ -19,7 +19,7 @@ def cloneNode(update, context):
limitint = int(limit[0])
res, clonesizelimit = gd.count(link)
if clonesizelimit != "":
msgg = f'Failed, clone limit is {CLONE_LIMIT}'
msgg = f'Failed, Clone limit is {CLONE_LIMIT}'
if 'GB' in limit or 'gb' in limit:
if clonesizelimit > limitint * 1024**3:
deleteMessage(context.bot, mssg)

View File

@ -150,11 +150,11 @@ class MirrorListener(listeners.MirrorListeners):
with download_dict_lock:
msg = f'<b>Filename: </b><code>{download_dict[self.uid].name()}</code>\n<b>Size: </b><code>{size}</code>'
if os.path.isdir(f'{DOWNLOAD_DIR}/{self.uid}/{download_dict[self.uid].name()}'):
msg += '\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{folders}'
msg += f'\n<b>Files: </b>{files}'
msg += '\n<b>Type: </b><code>Folder</code>'
msg += f'\n<b>SubFolders: </b><code>{folders}</code>'
msg += f'\n<b>Files: </b><code>{files}</code>'
else:
msg += f'\n<b>Type: </b>{typ}'
msg += f'\n<b>Type: </b><code>{typ}</code>'
buttons = button_build.ButtonMaker()
if SHORTENER is not None and SHORTENER_API is not None:
surl = requests.get(f'https://{SHORTENER}/api?api={SHORTENER_API}&url={link}&format=text').text

View File

@ -19,7 +19,7 @@ def _watch(bot: Bot, update, isTar=False):
except IndexError:
msg = f"/{BotCommands.WatchCommand} [youtube-dl supported link] [quality] |[CustomName] to mirror with youtube-dl.\n\n"
msg += "<b>Note: Quality and custom name are optional</b>\n\nExample of quality: audio, 144, 240, 360, 480, 720, 1080, 2160."
msg += "\n\nIf you want to use custom filename, plz enter it after |"
msg += "\n\nIf you want to use custom filename, enter it after |"
msg += f"\n\nExample:\n<code>/{BotCommands.WatchCommand} https://youtu.be/Pk_TthHfLeE 720 |Slam</code>\n\n"
msg += "This file will be downloaded in 720p quality and it's name will be <b>Slam</b>"
sendMessage(msg, bot, update)

View File

@ -33,7 +33,7 @@ MAX_TORRENT_SIZE = 15
# Fill only if you deploying with heroku-cli and Goorm IDE
HEROKU_API_KEY = ""
HEROKU_APP_NAME = ""
# Add more buttons (Three buttons are already added of file link and index link, you can add extra buttons too, these are optional)
# Add more buttons (Three buttons are already added of Drive Link, Index Link, and View Link, you can add extra buttons too, these are optional)
# If you don't know what are below entries, simply leave them, Don't fill anything in them.
BUTTON_FOUR_NAME = ""
BUTTON_FOUR_URL = ""