Code Monkey home page Code Monkey logo

deepak-clouds-tortoolkit-leech-mirror's Introduction

Slam

Deepak Clouds Tortoolkit Leech Mirror

Depoy To Heroku

Deploy

Features

Following are some awesome features offered by this bot:-

  • Using the best torrent client to deal with torrent : Ec3 AWS Amazon
  • You can choose which files you want to download from the torrent.
  • A glorious settings menu from you can control the bot.
  • If the bot is in the group, the users have their own settings like:
    • Permanent thumbnail support.
    • Users can choose if they want a file or video.
    • Load in their own rclone config so that the torrent/direct link is uploaded to their drive. (Work in Progress)
  • Extraction of ZIP, TAR, ISO, RAR wih and without password. If you chose to extarct the archive and you enter the password wrong it will prompt you to enter the password upto 3 times after that zip will be uploaded as it is.
  • G Drive Index support.
  • Admins can put hard limits on the max torrent size and max youtube playlist size.
  • Aria2 for direct links download.
  • Upload to gdrive by using RCLONE.
    • You can load multiple drives in the conf and can switch on fly using the settings.
  • Sorted YTDL download menu.
  • Zip and upload also available.
  • Get the server status.
  • InstaDL support
  • Browse the settings menu and try stuff. ;)

Note

Everytime before you leech, you need to visite the app url to startup the bot from idling

Or, you can prevent ideling your app by adding your url on http://kaffeine.herokuapp.com/

TorToolkit Telegram

So basically Tortoolkit is aimed to be most versatile torrent leecher and Youtube-DL bot for telegram. This bot is highly customizeable and to customize this bot you dont need to restart the bot everytime. The bot gets started with minimum variables and others can be set as and when needed using the /settings

Installing

Run the following commands. (Following commands can be used to setup the vps from scratch)

git clone https://github.com/yash-dk/TorToolkit-Telegram.git
sudo apt update
sudo apt install -y python3.8
sudo apt install -y python3-venv
python3 -m venv venv
source venv/bin/activate
cd TorToolkit-Telegram
pip install -r requirements.txt
sudo apt install -y postgresql postgresql-contrib
apt -qq install -y curl git wget python3 python3-pip aria2 ffmpeg mediainfo unzip p7zip-full p7zip-rar
curl https://rclone.org/install.sh | bash
apt-get install -y software-properties-common
apt-get -y update
add-apt-repository -y ppa:qbittorrent-team/qbittorrent-stable
apt install -y qbittorrent-nox

After that setup the database:- Remember the 'your-pass' that you enter below

sudo -u postgres bash
createdb tortk
psql
ALTER USER postgres with password 'your-pass';
exit
exit

After that setup the Variables. Assuming that you are in the dir where you clonned the repo

 cd TorToolkit-Telegram/tortoolkit/consts
 nano ExecVarsSample.py

Change the API_HASH, API_ID, BOT_TOKEN, ALD_USR and BASE_URL_OF_BOT Change DB_URI = "dbname=tortk user=postgres password=your-pass host=127.0.0.1 port=5432" enter the password in the above string After that run (You can use any port for the web interface here i am using 80) Each time before starting the bot export the port Number

export PORT=80

And finally run ./start.sh in clonned folder.

chmod 777 start.sh
./start.sh

Variables

IS_VPS = False

Compulsory Vars

API_HASH = Obtained from Telegram

API_ID = Obtained from Telegram

BOT_TOKEN = Obtained from Botfather

BASE_URL_OF_BOT = Ip/domain of your bot like "http://myip/"

ALD_USR = It is a list of IDs of all the allowed groups and useres who can use this bot in private.

DB_URI = Postgres database URL.

Optional Vars

(IT IS RECOMMENDED TO SET THE OPTIONAL VARS FROM SETTINGS MENU, If not all vars atleast use settings menu for RCLONE that way is much easier.)

EDIT_SLEEP_SECS = Seconds to Sleep before edits. Recommended is 40.

TG_UP_LIMIT = Telegram Upload limit in bytes.

FORCE_DOCUMENTS = Should all the upload to telegram be made as documents or not.

COMPLETED_STR = Character used to denote completed progress.

REMAINING_STR = Character used to denote remaining progress.

RCLONE_BASE_DIR = Rclone Base Directory to where stuff should be clonned. (cannot be configured from settings)

LEECH_ENABLED = Upload to telegram should be enabled or not.

RCLONE_ENABLED = Upload to rclone should be enabled or not.

DEFAULT_TIMEOUT = Default destination to choose if the user fails to choose upload destination in 60 seconds.

RCLONE_CONFIG = Rclone file path.

DEF_RCLONE_DRIVE = Default Rclone drive from the config file.

MAX_YTPLAYLIST_SIZE = Max size of a playlist that is allowed (Number of videos)

MAX_TORRENT_SIZE = Max torrent size in GBs

Rest Variables are not to changes

Commands

leech - To Leech a torrent or download a direct link
ytdl - Donwload YouTube Video
pytdl - Download YouTube Playlist
about - About the bot
status - Status of all the downloads
server - Get server status
usettings - User Settings
settings - Settings of the bot ⚠️ Admin Only
pauseall - Pause all torrents⚠️ Admin Only
resumeall - Resume all torrents⚠️ Admin Only
purge - Delete all torrents ⚠️ Admin Only
getlogs - Get the robot logs ⚠️ Admin Only

Credits

Yash-DK

deepak-clouds-tortoolkit-leech-mirror's People

Contributors

deepakcloudsoffical avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deepak-clouds-tortoolkit-leech-mirror's Issues

ModuleNotFoundError: No module named 'tortoolkit.core.database_handle'

2022-05-20T08:07:49.886683+00:00 app[web.1]:   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
2022-05-20T08:07:49.886683+00:00 app[web.1]:   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2022-05-20T08:07:49.886684+00:00 app[web.1]:   File "/torapp/tortoolkit/__init__.py", line 13, in <module>
2022-05-20T08:07:49.886684+00:00 app[web.1]:     from tortoolkit.core.server import start_server
2022-05-20T08:07:49.886684+00:00 app[web.1]:   File "/torapp/tortoolkit/core/server.py", line 7, in <module>
2022-05-20T08:07:49.886684+00:00 app[web.1]:     from .database_handle import TtkTorrents
2022-05-20T08:07:49.886685+00:00 app[web.1]: ModuleNotFoundError: No module named 'tortoolkit.core.database_handle'
2022-05-20T08:07:49.886791+00:00 app[web.1]: [2022-05-20 13:37:49 +0530] [11] [INFO] Worker exiting (pid: 11)
2022-05-20T08:07:50.045985+00:00 heroku[web.1]: Process exited with status 1
2022-05-20T08:07:50.178875+00:00 heroku[web.1]: State changed from starting to crashed

Please Help

(venv) root@ip-172-31-40-27:/home/ubuntu/tgBot/TorToolkit-Telegram# ./start.sh
[2021-07-05 15:45:16 +0000] [217555] [INFO] Starting gunicorn 20.0.4
[2021-07-05 15:45:16 +0000] [217555] [INFO] Listening at: http://0.0.0.0:80 (217555)
[2021-07-05 15:45:16 +0000] [217555] [INFO] Using worker: aiohttp.GunicornWebWorker
[2021-07-05 15:45:16 +0000] [217566] [INFO] Booting worker with pid: 217566
2021-07-05 15:45:16,458 INFO MainThread root Database created
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/init.py", line 19, in
upload_db = TtkUpload()
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/core/database_handle.py", line 116, in init
super().init(dburl)
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/functions/pg_plugin.py", line 28, in init
self._conn = psycopg2.connect(self._dburl)
File "/home/ubuntu/venv/lib/python3.8/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"

Exception ignored in: <function TtkUpload.del at 0x7f024eabee50>
Traceback (most recent call last):
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/core/database_handle.py", line 218, in del
super().del()
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/functions/pg_plugin.py", line 74, in del
self._connection_users.pop()
IndexError: pop from empty list
2021-07-05 15:45:16,514 INFO MainThread root Database created
[2021-07-05 15:45:16 +0000] [217566] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/home/ubuntu/venv/lib/python3.8/site-packages/aiohttp/worker.py", line 51, in init_process
super().init_process()
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
self.load_wsgi()
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
self.wsgi = self.app.wsgi()
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
return self.load_wsgiapp()
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/ubuntu/venv/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
mod = importlib.import_module(module)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/init.py", line 19, in
upload_db = TtkUpload()
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/core/database_handle.py", line 116, in init
super().init(dburl)
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/functions/pg_plugin.py", line 28, in init
self._conn = psycopg2.connect(self._dburl)
File "/home/ubuntu/venv/lib/python3.8/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"

[2021-07-05 15:45:16 +0000] [217566] [INFO] Worker exiting (pid: 217566)
Exception ignored in: <function TtkUpload.del at 0x7effaf1555e0>
Traceback (most recent call last):
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/core/database_handle.py", line 218, in del
super().del()
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/functions/pg_plugin.py", line 74, in del
self._connection_users.pop()
IndexError: pop from empty list
(venv) root@ip-172-31-40-27:/home/ubuntu/tgBot/TorToolkit-Telegram# [2021-07-05 15:45:16 +0000] [217555] [INFO] Shutting down: Master
[2021-07-05 15:45:16 +0000] [217555] [INFO] Reason: Worker failed to boot.

Error

[2021-07-05 15:22:04 +0000] [205581] [INFO] Starting gunicorn 20.0.4
[2021-07-05 15:22:04 +0000] [205581] [ERROR] Connection in use: ('0.0.0.0', 80)
[2021-07-05 15:22:04 +0000] [205581] [ERROR] Retrying in 1 second.
2021-07-05 15:22:04,205 INFO MainThread root Database created
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/init.py", line 19, in
upload_db = TtkUpload()
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/core/database_handle.py", line 116, in init
super().init(dburl)
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/functions/pg_plugin.py", line 28, in init
self._conn = psycopg2.connect(self._dburl)
File "/home/ubuntu/venv/lib/python3.8/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"

Exception ignored in: <function TtkUpload.del at 0x7f0615052e50>
Traceback (most recent call last):
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/core/database_handle.py", line 218, in del
super().del()
File "/home/ubuntu/tgBot/TorToolkit-Telegram/tortoolkit/functions/pg_plugin.py", line 74, in del
self._connection_users.pop()
IndexError: pop from empty list
(venv) root@ip-172-31-40-27:/home/ubuntu/tgBot/TorToolkit-Telegram# [2021-07-05 15:22:05 +0000] [205581] [ERROR] Connection in use: ('0.0.0.0', 80)
[2021-07-05 15:22:05 +0000] [205581] [ERROR] Retrying in 1 second.
[2021-07-05 15:22:06 +0000] [205581] [ERROR] Connection in use: ('0.0.0.0', 80)
[2021-07-05 15:22:06 +0000] [205581] [ERROR] Retrying in 1 second.
[2021-07-05 15:22:07 +0000] [205581] [ERROR] Connection in use: ('0.0.0.0', 80)
[2021-07-05 15:22:07 +0000] [205581] [ERROR] Retrying in 1 second.
[2021-07-05 15:22:08 +0000] [205581] [ERROR] Connection in use: ('0.0.0.0', 80)
[2021-07-05 15:22:08 +0000] [205581] [ERROR] Retrying in 1 second.
[2021-07-05 15:22:09 +0000] [205581] [ERROR] Can't connect to ('0.0.0.0', 80)

Nezar

Hello , I'm trying to figure out how it works!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.