Telegram bot that scrapes Piratebay and can add torrents to Transmission
Create virtual environment and activate it. Run pip install -r requirements.txt to install all dependencies. Fill in Telegram bot token, transmission
username & password, as well as host and port in config_example.yaml and rename it to
config.yaml.
Then run torrbot.py to start up the bot using python torrbot.py.
The bot knows the following commands:
- /help - Shows all available commands
- /piratesearch (n) query - Show first n results for query on Piratebay
- /more - Show 5 more results for Query
- /download idx - Download torrent with idx from previous piratesearch
- /listtorrents - List all torrents in Transmission
- /deletealltorrents - Delete all torrents in Transmission
- /deletetorrent idx - Delete torrent with idx from previous listtorrent
This is an example to show how the bot works:
- Type
/piratesearch 15 linux. This will show the top 15 results from piratebay. - Type
/moreto show 5 more results. - Type
/download 17to download the result at position 17 in the table returned by /pirateserach - Type
/listtorrentsto check if the torrent was properly added. - Type
/deletetorrent 31to delete the torrent with index 31. The index is shown by /listtorrents.
The torrbot_completedNotification.sh script sends a message to your telegram when a torrent is completed. To use the it there are several steps required.
- Fill in the bots token and the chat ID to which the message will be sent.
- Stop the transmission torrent by typing
sudo service transmission-daemon stop - Allow the execution of the script
sudo chmod +rx torrbot_completedNotification.sh - Open the transmission-daemon settings file by
sudo nano /etc/transmission-daemon/settings.jsonand change the following:
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/path/to/torrbot_completedNotification.sh", - Restart the transmission daemon with
sudo service transmission-daemon start