Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > Autodl-irssi

Autodl-irssi is a method of automatically downloading torrents from IRC announce channels based on defined filters.

A valid configuration file is required to activate the ruTorrent plug-in.

Installation

If you do not already have autodl-irssi configuration files created on your slot:

  1. SSH into your server.
  2. Download autodlsetup.sh. wget https://whatbox.ca/shell/autodl-setup.sh
  3. Run the downloaded script. bash autodl-setup.sh
  4. You can now manage autodl-irssi with the ruTorrent plugin. Access ruTorrent at https://server.whatbox.ca/webui

Configuration

You can find a comprehensive usage guide at its GitHub.

Configuration files

All filters and other options are read from ~/.autodl/autodl.cfg. If you use non-ASCII characters, be sure to set the encoding (or character coding) to UTF-8 before saving it. The file will be automatically re-read whenever you make any modifications to it when autodl-irssi is running.

Note: Configuration for use with rTorrent can now be done through the ruTorrent plug-in, so manual configuration for rTorrent through the autodl.cfg configuration file is unnecessary unless you do not wish to use the ruTorrent plug-in.

Automatically restart

Below are steps to take to have your irssi instance automatically restart if it crashes, or if the server is rebooted.

  1. Make a file to be used for the script. touch ~/irssi_restart.cron

  2. Edit the file and enter the text below. nano -w ~/irssi_restart.cron

     #!/bin/bash
     if pgrep -fx "irssi" > /dev/null
     then
         echo "irssi is running."
     else 
         echo "irssi is not running, starting irssi"
         screen -dmS autodl irssi
     fi
     exit
    
  3. Save the file with Ctrl+x and the "y" and Enter to accept overwriting.

  4. Make the script executable. chmod +x ~/irssi_restart.cron

  5. Open your crontab. EDITOR=nano crontab -e

  6. Enter the following text

     @reboot /home/user/irssi_restart.cron >/dev/null 2>&1
     */5 * * * * /home/user/irssi_restart.cron >/dev/null 2>&1
    
  7. Save the crontab with Ctrl+x and the "y" and Enter to accept overwriting.

Manual installation (optional)

irssi

  1. SSH into your server.
  2. Start irssi with the command irssi
  3. Create a new hidden window. /window new hidden
  4. Name that window "autodl". /window name autodl
  5. Move the new window to position 2. /window move 2
  6. Save the layout. /layout save
  7. Save all settings. /save
  8. Exit irssi. /exit

autodl-irssi

  1. mkdir -p ~/.irssi/scripts/autorun
  2. cd ~/.irssi/scripts
  3. curl -sL http://git.io/vlcND | grep -Po '(?<="browser_download_url":")(.*-v[\d.]+.zip)' | xargs wget --quiet -O autodl-irssi.zip
  4. unzip -o autodl-irssi.zip
  5. rm autodl-irssi.zip
  6. cp autodl-irssi.pl autorun/
  7. mkdir -p ~/.autodl
  8. touch ~/.autodl/autodl.cfg

The configuration file has now been created, and is located at ~/.autodl/autodl.cfg
To edit it, use nano ~/.autodl/autodl.cfg

Once you have configured the autodl.cfg file, start irssi and the script will automatically run.
It is recommended to run irssi in a screen, so that you may close the terminal and irssi will continue to run.
screen -S autodl irssi will create a screen named "autodl" and it will run the program "irssi".
To close the irssi session and have it continue running, simply detach from the screen with Ctrl+A, d
To reattach to the irssi session and view matches as they occur, run screen -r autodl

Manual configuration options (advanced)

rTorrent

[options]
max-saved-releases = 1000
save-download-history = true
download-duplicates = false
upload-type = rtorrent
rt-dir = ~/files
rt-address = ~/.config/rtorrent/socket
update-check = auto
unique-torrent-names = false

For other clients, use upload-type = watchdir and specify a path using upload-watch-dir.

Issues

"Error downloading files. Make sure autodl-irssi is started and configured properly (eg. password, port number): Error getting files listing: Error: Could not connect: (111) Connection refused"

This means that irssi is not running or multiple instances are running.
SSH into the server and run killall irssi; screen -dmS autodl irssi

To disable autodl-irssi in irssi for regular use run /script unload autodl_irssi in the irssi session.