Add new vars
This commit is contained in:
parent
170e3a4f8b
commit
81f7a29ea7
18
README.md
18
README.md
|
|
@ -10,18 +10,21 @@
|
|||

|
||||

|
||||

|
||||

|
||||
[](https://t.me/SlamMirrorSupport)
|
||||
|
||||
**Slam Mirror Bot** is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.
|
||||
**Slam Mirror Bot** is a _multipurpose_ Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.
|
||||
|
||||
# Features supported:
|
||||
<details>
|
||||
<summary><b>Click here for more details</b></summary>
|
||||
|
||||
## Additional Features
|
||||
- Get detailed info about replied media (Only for Telegram file)
|
||||
- Nyaa.si and Sukebei Torrent search
|
||||
- Speedtest with picture results
|
||||
- Stop duplicate clone Google Drive support
|
||||
- Limiting cloning Google Drive support
|
||||
- Limiting Torrent size support
|
||||
- Stop duplicate cloneing Google Drive & mirroring Mega support
|
||||
- Limiting size Torrent, Mega, cloning Google Drive support
|
||||
- Sudo with Database support
|
||||
- Multiple Trackers support
|
||||
- Check Heroku dynos stats
|
||||
|
|
@ -61,6 +64,7 @@ APM, ARJ, CHM, CPIO, CramFS, DEB, DMG, FAT,
|
|||
HFS, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS,
|
||||
NTFS, RPM, SquashFS, UDF, VHD, XAR, Z.
|
||||
```
|
||||
</details>
|
||||
|
||||
# How to deploy?
|
||||
Deploying is pretty much straight forward and is divided into several steps as follows:
|
||||
|
|
@ -140,9 +144,11 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
|
|||
- **MEGA_PASSWORD**: Your password for your mega.nz account
|
||||
- **BLOCK_MEGA_FOLDER**: If you want to remove mega.nz folder support, set it to `True`.
|
||||
- **BLOCK_MEGA_LINKS**: If you want to remove mega.nz mirror support, set it to `True`.
|
||||
- **STOP_DUPLICATE_MIRROR**: (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)
|
||||
- **STOP_DUPLICATE_CLONE**: (Leave empty if unsure) if this field is set to `True`, bot will check file in drive, if it is present in Drive, cloning will be stopped.
|
||||
- **STOP_DUPLICATE_MIRROR**: (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)
|
||||
- **STOP_DUPLICATE_MEGA**: (Leave empty if unsure) if this field is set to `True`, bot will check file in Drive, if it is present in Drive, downloading Mega will be stopped.
|
||||
- **STOP_DUPLICATE_CLONE**: (Leave empty if unsure) if this field is set to `True`, bot will check file in Drive, if it is present in Drive, cloning will be stopped.
|
||||
- **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`.
|
||||
- **MEGA_LIMIT**: To limit downloading Mega (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**: Show Image/Logo in /start message. Fill value of image your link image, use telegra.ph or any direct link image.
|
||||
|
|
|
|||
8
app.json
8
app.json
|
|
@ -112,10 +112,18 @@
|
|||
"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
|
||||
},
|
||||
"MEGA_LIMIT": {
|
||||
"description": "To limit mirroring Mega (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
|
||||
},
|
||||
"STOP_DUPLICATE_MEGA": {
|
||||
"description": "If this field is set to True, bot will check file in Drive, if it is present in Drive, downloading Mega will be stopped.",
|
||||
"required": false
|
||||
},
|
||||
"STOP_DUPLICATE_CLONE": {
|
||||
"description": "If this field is set to True, bot will check file in Drive, if it is present in Drive, cloning will be stopped.",
|
||||
"required": false
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ class MegaDownloadHelper:
|
|||
limit = MEGA_LIMIT
|
||||
limit = limit.split(' ', maxsplit=1)
|
||||
limitint = int(limit[0])
|
||||
msg3 = f'Failed, Mega limit is {MEGA_LIMIT}.\n\nYour File/Folder size is {get_readable_file_size(api.getSize(node))}.'
|
||||
msg3 = f'Failed, Mega limit is {MEGA_LIMIT}.\nYour File/Folder size is {get_readable_file_size(api.getSize(node))}.'
|
||||
if 'GB' in limit or 'gb' in limit:
|
||||
if api.getSize(node) > limitint * 1024**3:
|
||||
deleteMessage(listener.bot, msg2)
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ class GoogleDriveHelper:
|
|||
for file in response.get('files', []):
|
||||
if file.get('mimeType') == "application/vnd.google-apps.folder": # Detect Whether Current Entity is a Folder or File.
|
||||
furl = f"https://drive.google.com/drive/folders/{file.get('id')}"
|
||||
msg += f"⁍<code>{file.get('name')}<br>(folder)📁</code><br>"
|
||||
msg += f"📁 <code>{file.get('name')}<br>(folder)</code><br>"
|
||||
if SHORTENER is not None and SHORTENER_API is not None:
|
||||
sfurl = requests.get(f'https://{SHORTENER}/api?api={SHORTENER_API}&url={furl}&format=text').text
|
||||
msg += f"<b><a href={sfurl}>Drive Link</a></b>"
|
||||
|
|
@ -571,7 +571,7 @@ class GoogleDriveHelper:
|
|||
# Excluded index link as indexes cant download or open these shortcuts
|
||||
else:
|
||||
furl = f"https://drive.google.com/uc?id={file.get('id')}&export=download"
|
||||
msg += f"⁍<code>{file.get('name')}<br>({get_readable_file_size(int(file.get('size')))})📄</code><br>"
|
||||
msg += f"📄 <code>{file.get('name')}<br>({get_readable_file_size(int(file.get('size')))})</code><br>"
|
||||
if SHORTENER is not None and SHORTENER_API is not None:
|
||||
sfurl = requests.get(f'https://{SHORTENER}/api?api={SHORTENER_API}&url={furl}&format=text').text
|
||||
msg += f"<b><a href={sfurl}>Drive Link</a></b>"
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ MEGA_PASSWORD = ""
|
|||
BLOCK_MEGA_FOLDER = ""
|
||||
BLOCK_MEGA_LINKS = ""
|
||||
STOP_DUPLICATE_MIRROR = ""
|
||||
STOP_DUPLICATE_MEGA = ""
|
||||
STOP_DUPLICATE_CLONE = ""
|
||||
STOP_DUPLICATE_MEGA = ""
|
||||
SHORTENER = ""
|
||||
SHORTENER_API = ""
|
||||
CLONE_LIMIT = "" #leave space between number and unit (TB or GB only)
|
||||
CLONE_LIMIT = "" # leave space between number and unit (TB or GB only)
|
||||
MEGA_LIMIT = ""
|
||||
IMAGE_URL = "https://telegra.ph/file/db03910496f06094f1f7a.jpg"
|
||||
# Change ENABLE_FILESIZE_LIMIT = True if you want to use MAX_TORRENT_SIZE
|
||||
|
|
|
|||
Loading…
Reference in New Issue