IRC bot to auto-download torrents and more.
Branch: master
Clone or download
jimrollenhagen Update botwho for redacted
Looks like this changed to `Drone@`:

`11:47:12                   pth  -- | [Drone] (Drone@ Drone`
Latest commit f93d574 Jun 29, 2018


An IRC bot that can auto-download torrents, download on command, and provides a download button via a browser userscript.

Desperately in need of a rewrite.

Setup instructions

Get the files


Just use git clone at the location you want to run your bot from.


Grab the zip file from

Extract the files

If you are on a linux machine just run unzip and you'll end up with a directory called pywhatauto-master.

Edit the configuration files


Copy setup.conf.example to setup.conf

Setup the watch directory:


Setup the drive you want to show freespace on (usually the dir you download to):


Set the size of your download drive (in GB):


Set the percentage of your storage to use (stops downloading torrents when drive is this full):


Set log to 0 if you don't want to keep logs:


Set chatter to 0 if you don't want to see channel traffic:


Under [sites], enable the networks you want to watch, 1 is on, 0 is off.

whatcd=0 to whatcd=1 for example.

If you want to use the download button make sure to change the password and port for the web interface. For a more in-depth explanation of the download button read the "Download button" section below.


Copy credentials.conf.example to credentials.conf

In this file you'll have to add the credentials to the various sites and setup your bot on the IRC network. We'll take a look on how this'll look for What.CD:


nickowner Run /whois yourusername on the IRC network and you'll see the hostmask. That's what we need.

chanfilter You don't have to change that. That's the channel where you can "talk" to your bot and issue commands.

username Your What.CD username.

password Your What.CD password.

botNick The nick your bot will join the #whatbot channel and the announce channels.

ircKey Your IRC key you setup in your What.CD user profile.

nickServPass Your bot's NickServ password. You have to make sure your bot's IRC nick is registered. You can do that by changing your nick and using the REGISTER command like this:

/nick yourusername|pyWHATbot
/msg nickserv register yourpassword
/whois yourusername|pyWHATbot

If you want to group your bot nick and your main account so you can use the same NickServ password for both accounts you'll have to run the following commands:

/nick yourusername|pyWHATbot
/nickserv group yourusername <your regular nickserv password>

watch This is the directory you want the bot to store the .torrent files it snatched. This should also be your torrent client's watch directory.


Copy filters.conf.example to filters.conf

This is the file where you tell your bot which releases it should grab for you.

To get an idea which options are possible please read the filters.conf included with this release.


Here's an example to grab all of the 100% Log/Cue Flacs from the year 2014, if you wanted to download regardless of the year, just remove the line year=2014:


If you are just interested in specific artists you could add them like this. Note that regex must be prefixed with @:

artist=Widespread Panic
        Trey Anastasio
        @Umphrey(.+)s McGee
        @Jerry Joseph.*

Start the bot

To start the bot just run python which is located in the pywhatauto directory. Make sure the python version you are using to execute it is < than 3 (Check with python --version). If your operating system defaults to a newer version you'll have to manually specify the version and start it like this: python2.7

Currently your bot will close the connection to the IRC network if you close your terminal. To keep it running in the background even if you close your terminal it's recommended to use something like screen or tmux.

To use screen type screen -S nameofmyscreen and press return. In the new screen you just opened just navigate to the place where your is located and then run it like explained above. Now we'll have to detach the window with ctrl + a + d. You'll be back at the place where we started before you typed the screen command. If you want to list your screens running in the background just type screen -ls and you'll get a list of screens which'll look like this:

There are screens on:
        8304.test       (Detached)
        27582.pywhatauto        (Detached)
2 Sockets in /home/dewey/.screen.

To attach to a detached screen just type screen -r 27582 and you'll be back at your bot's screen.

Sending commands to the bot

If you want to get informations from your bot or issue download commands just join the same channel your bot is sitting in on the IRC net work and type %help. Your bot should now respond to your commands.

Download button

If you want to use the pyWA download button to send torrents to your bot via your browser you'll need to install the user script located in your pywhatauto-master directory. It's called button.user.js.

The older (original) version can be found at

Once the script is installed, you will need to either visit your settings page on a gazelle based site and configure the script (All fields auto save) or change the var weblink line at the top of script.

Settings preview

The port and password of the web interface are configured in the setup.conf. The relevant bits looks like this:

;WEBUI password
;WEBUI port

The hostname can be an IP address or domain pointing towards your server.


If you are having troubles getting your bot to work just join #whatbot on the PTH IRC network.