Setting up pyWhatAuto (autodownloader)
From Bytesized Wiki
Contents |
What is pyWhatAuto?
pyWhatAuto is a standalone autodownloader written by johnnyfive/blubba. Once set up, it'll catch IRC announcements and download the torrent file to your watch directory (or wherever you point it to).
WARNING: Read this first!
This HOWTO is written for pyWhatAuto 1.72!
Requirements
The only dependency for pyWHATauto is having Python 2.5 or 2.6. If you're on a VPS, you may need to install this. All seedbox slices have this prerequisite.
Downloading the file
Log into your VNC or SSH in your slice. If you are in VNC, open up the lxterminal. Type:
wget http://www.whatscripts.com/release-1.72.zip
this will download a .zip file. Now, we need to unpack the file, type:
unzip -d pyWhatAuto release-1.72.zip
this will unzip the files in to the pyWhatAuto directory.
NOTE: If you get an error saying:
-bash: unzip: command not found
or something along those lines, come by our IRC. It is possible that unzip is not installed. Just say what server you are on and that you need unzip installed. You can also create a ticket if IRC is too much of a bother.
Filling out the necessary information
Before we start editing the configuration files, we need to make sure that we know our home folder location. To get this information type:
cd && pwd
or
echo $HOME
in your terminal. You will get something similar to this:
/home/hd1/max
where /home/hd1/max is your home directory.
setup.conf
Open up your setup.conf file inside the pyWhatAuto directory, type in your terminal:
nano ~/pyWhatAuto/release-1.72/setup.conf
Find these lines, and fill them with your informations:
- torrentDir= - you will put location to your watch folder. This will in your torrents folder in your home folder. For example, mine would be /home/hd1/max/torrents/watch
- drive= - path to your home folder. In my case, /home/hd1/maxl
- limit= - size of your slice. I used to have 110GB slice so I would put 110.
Everything else can be left as it is. You can hold CTRL while pressing X,enter Y to save the modifications you made, then press ENTER.
credentials.conf
Before we start editing the file, we need to register our bot. These next steps are for what.cd, but something similar is done for other sites.
Registering your bots nick
Go to what.cd IRC( you can find howto in their wiki). After you registered with drone, in your IRC chat client type:
/nick yournick|pyWHATbot
of course, change yournick to your actual nick :) Next,
/msg nickserv register yournickservpass [email protected]
and finally,
/whois yournick|pyWHATbot
If you did everything right, after you`ve typed this last command, you should get something similar to this:
[yournick|pyWHATbot] ([email protected]) : yourusername [yournick|pyWHATbot] #what.cd-announce #whatbot [yournick|pyWHATbot] irc.what-network.net :What-Network [yournick|pyWHATbot] is logged in as yournick|pyWHATbot [yournick|pyWHATbot] is a registered nick [yournick|pyWHATbot] is using a secure connection [yournick|pyWHATbot] End of WHOIS list.
Now you can change your nick back, and we can continue editing files in your terminal window.
Editing credentials
Next, credentials.conf:
nano ~/pyWhatAuto/release-1.72/credentials.conf
Scroll down to the bottom of the file and fill out your information:
[whatcd] [email protected] we got this one by doing a /whois, scroll up a few lines :) chanfilter=#whatbot channel you want your bot to be controlled from username=yoursiteusername your site username on what.cd password=yoursitepassword your site password on what.cd botNick=yourusername|pyWHATbot your bot's nickname that we registered few lines up ircKey=yourirckey your irckey that's set on your what.cd site profile nickServPass=yournickservpass the nickserv password you registered for your bot
We are done, save the changes (You can hold CTRL while pressing X,enter Y to save the modifications you made, then press ENTER.)
filters.conf
Final step,
nano ~/pyWhatAuto/release-1.72/filters.conf
There are already some examples in the file, but we will write the most common used one, autosnatching MP3 V0 2011(this is (re)written in 2011:) ) :
[WHAT_CD] site=whatcd filterType=music active=0 source=CD quality=V0 (VBR) format=MP3 year=2011
Save the changes and exit nano.
Now, this filter is, at the moment, most used one for creating some buffer on what.cd. You can use pyWhatAuto to snatch artists, editions you actually like. For tweaks on the filters join #whatbot on irc.what-network.net and ask around.
UPDATE: What.cd changed their server address so we need to edit another config file: regex.conf
nano ~/pyWhatAuto/release-1.72/regex.conf
and then change the server to: s3.what-network.net
Starting pyWhatAuto
After all this editing, we now get to start it up \o/ In terminal type:
screen -S pywa python ~/pyWhatAuto/WHATauto.py
, bunch of lines will appear and if you filled all your informations right, torrent downloading will start once the filters match.
You can detach screen to leave it running. Press ctrl then a, then d, this will detach screen and pyWhatAuto will work in background. If you want do attach it again, type screen -r pid.pywa, where pid is a number of process.
Controlling your bot
Join #whatbot on irc.what-network.net and type:
%help
to see all the commands you can use to control your bot( of course, your bot needs to be running). Most commonly used commands are:
%stats for listing the stats of downloaded and seen torrents %filter enable filtername for enabling filter called filtername %filter disable filtername
and so on.
Credits
If you find this script useful, thank johnnyfive and blubba in #whatbot, they would like that! Also, if you can afford to donate, visit http://whatscripts.com/ , makes johnnyfives` and blubbas` efforts little more appreciated :)