diff --git a/README.md b/README.md index 6b6aec6..60320cd 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This is a telegram bot writen in python for mirroring files on the internet to o - Mirroring Uptobox.com links to Google Drive (Uptobox account must be premium) - Nyaa.si and Sukebei Torrent search - Speedtest with picture results +- Limiting torrent size support - Check Heroku dynos stats - Add stickers to your pack - Shell and Executor @@ -36,7 +37,7 @@ HFS, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RPM, SquashFS, UDF, VHD, XAR, Z. ``` -## How to deploy? +# How to deploy? Deploying is pretty much straight forward and is divided into several steps as follows: ## Installing requirements @@ -139,10 +140,9 @@ sudo docker run mirrorbot ## Deploying on Heroku -Fork this repo, then upload **token.pickle** to your forks - -**NOTE**: If you didn't upload **token.pickle** upload will not working -
+- Fork this repo +- Upload **token.pickle** to your forks + ## Deploying on Heroku using heroku-cli @@ -247,7 +247,7 @@ machine host login username password my_youtube_password ``` where host is the name of extractor (eg. youtube, twitch). Multiple accounts of different hosts can be added each separated by a new line -## Credits +# Credits Thanks to: - [out386](https://github.com/out386) heavily inspired from telegram bot which is written in JS diff --git a/app.json b/app.json index 80fba1f..1cf1206 100644 --- a/app.json +++ b/app.json @@ -105,13 +105,13 @@ }, "ENABLE_FILESIZE_LIMIT": { "description": "Set it to True if you want to use MAX_TORRENT_SIZE.", - "value": "false", - "required": true + "value": "False", + "required": falae }, "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.", "value": "15", - "required": true + "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.", diff --git a/bot/__init__.py b/bot/__init__.py index c4b0eaa..0fa490f 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -86,11 +86,14 @@ try: AUTO_DELETE_MESSAGE_DURATION = int(getConfig('AUTO_DELETE_MESSAGE_DURATION')) TELEGRAM_API = getConfig('TELEGRAM_API') TELEGRAM_HASH = getConfig('TELEGRAM_HASH') - MAX_TORRENT_SIZE = int(getConfig("MAX_TORRENT_SIZE")) except KeyError as e: LOGGER.error("One or more env variables missing! Exiting now") exit(1) +try: + MAX_TORRENT_SIZE = int(getConfig("MAX_TORRENT_SIZE")) +except KeyError: + MAX_TORRENT_SIZE = None try: ENABLE_FILESIZE_LIMIT = getConfig('ENABLE_FILESIZE_LIMIT') if ENABLE_FILESIZE_LIMIT.lower() == 'true': diff --git a/config_sample.env b/config_sample.env index a730772..0cfd838 100644 --- a/config_sample.env +++ b/config_sample.env @@ -23,11 +23,11 @@ MEGA_PASSWORD = "" BLOCK_MEGA_FOLDER = "" BLOCK_MEGA_LINKS = "" STOP_DUPLICATE_MIRROR = "" -MAX_TORRENT_SIZE = 15 -#change ENABLE_FILESIZE_LIMIT = true if you want to use MAX_TORRENT_SIZE -ENABLE_FILESIZE_LIMIT = false SHORTENER = "" SHORTENER_API = "" +# Change ENABLE_FILESIZE_LIMIT = True if you want to use MAX_TORRENT_SIZE +ENABLE_FILESIZE_LIMIT = false +MAX_TORRENT_SIZE = 15 # Add more buttons (two buttons are already added of file link and index 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_THREE_NAME = ""