Info

Last Change
Last Editor keanu

Index

Autodl-irssi

This guide heavily borrows from the script's home page, but has been formatted here for ease of use with Whatbox and adds some additional information.

Autodl-irssi is a method of automatically downloading torrents from IRC announce channels depending on a set of filters you set up.

A random port number between 10000 and 65535 is needed for this setup. The port number 39410 has automatically been generated and will be used throughout this article, but can be changed if needed.

Installation

ruTorrent

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. Refresh ruTorrent.

If you have previously setup autodl-irssi for use without the ruTorrent plug-in, follow these steps:

  1. Under your [options] header in the autodl.cfg configuration file, add
    gui-server-port = 39410
    gui-server-password = PASSWORD
    Where PASSWORD is some arbitrary password that you create (the password will never be used; it's simply a requirement for the plug-in).
  2. Refresh ruTorrent.

Other clients

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. wget -O autodl-irssi.zip https://autodl-irssi-community.googlecode.com/files/autodl-irssi-community.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

Configuration

ruTorrent Plugin

The ruTorrent autodl-irssi plugin allows you to configure autodl-irssi without having to leave ruTorrent or edit a single configuration file. You can find a comprehensive usage guide at ruTorrent's Wiki page for autodl-irssi

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.

Options

rTorrent

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

rTorrent users will also need to create a second configuration file: touch ~/.autodl/autodl2.cfg
Edit the new configuration file to have your RPC socket's location: nano ~/.autodl/autodl2.cfg
In this file, only have this information:
[options]
rt-address = ~/.config/rtorrent/socket
Save the file and continue editing the first configuration file.

Other clients

[options]
max-saved-releases = 1000
save-download-history = true
download-duplicates = false
upload-type = watchdir
upload-watch-dir = ~/watch
update-check = auto
unique-torrent-names = false

The options header

These options change the behavior of autodl-irssi. Place these options below the [options] header.

Name: update-check
Type: string
Default: ask
Example: update-check = auto
Description: autodl-irssi can auto update itself. Valid values are ask, auto, and disabled. ask will print a message when there's a new version. auto will automatically update it when there's a new version. disabled won't do a thing when there's a new update.

Name: max-saved-releases
Type: Integer greater than or equal to 0.
Default: 1000
Example: max-saved-releases = 200
Description: autodl-irssi will remember the last max-saved-releases releases you have downloaded so it won't re-download the same file again. Only useful if save-download-history is enabled.

Name: save-download-history
Type: Boolean
Default: true
Example: save-download-history = true
Description: Set it to false to disable writing the last N (= max-saved-releases) downloaded releases to ~/.autodl/DownloadHistory.txt.

Name: download-duplicates
Type: Boolean
Default: false
Example: download-duplicates = true
Description: By default, it's false so no duplicate releases are downloaded. Set it to true if you want to download the same release again if it's re-announced.

Name: unique-torrent-names
Type: Boolean
Default: false
Example: unique-torrent-names = true
Description: If true, all saved torrent filenames are unique (the site name is prepended to the filename). Set it to false to use the torrent release name as the filename.

Name: download-retry-time-seconds
Type: Integer
Default: 300
Example: download-retry-time-seconds = 120
Description: If a download fails, autodl-irssi will try to re-download it after waiting a little while. If it still can't download it after download-retry-time-seconds seconds, it will give up and report an error.

rTorrent only

rt-dir is the destination directory. The torrent data will be saved here. Macros can be used.
rt-commands can be used to execute some rtorrent commands when loading the torrent file. It's for advanced users only.
rt-label is used to set a ruTorrent label.
rt-ratio-group is used to set a ruTorrent ratio group. Valid names are rat0, rat1, ..., rat7.
rt-channel is used to set a ruTorrent channel. Valid names are thr
0, thr1, ..., thr9.
rt-priority sets the torrent priority. Valid values are 0, dont-download, 1, low, 2, normal, 3, high. If you set it to dont-download (or 0), the torrent is loaded, but not started.
rt-ignore-scheduler: set it to true to disable the ruTorrent scheduler.
rt-dont-add-name: set it to true if you don't want the torrent name to be added to the path.

TV-shows/movies template

(note that wildcards aren't necessary in the shows filter option!)
[filter TV SHOW MOVIE FILTER TEMPLATE]
shows = The Simpsons, Other show, 3rd Show, Some movie, Movie #2
max-size = 2GB
#seasons = 3-8
#episodes = 0-99
resolutions = SD, 720p
sources = HDTV, DVDRip, BluRay
encoders = xvid, x264
#years = 2008-2012, 1950
#match-sites =

Music template

[filter MUSIC FILTER TEMPLATE]
match-sites = what, waffles
min-size = 30MB
max-size = 1GB
years = 1950-1969, 2000, 2009-2099
#shows = ArtistOrGroup #1, ArtistOrGroup #2, etc
#albums = Album #1, Album #2, etc
formats = MP3, FLAC
bitrates = v0 (vbr), lossless
media = CD
#tags = hip hop, tag #2, tag #3
#tags-any = true
#except-tags = hip hop, tag #2, tag #3
#except-tags-any = false
#scene =
#log =
#cue =

Random scene releases

[filter RANDOM SCENE RELEASE FILTER TEMPLATE]
match-releases = the?simpsons*, american?dad*, blah*
except-releases = *-LOL, *-crapgroup, crap.release*
#match-sites =
#except-sites =
#min-size = 10MB
max-size = 500MB
#max-pretime = 3 secs
#match-uploaders =
#except-uploaders =

All releases from a certain category

[filter CATEGORY FILTER TEMPLATE]
match-categories = *MP3*, *XVID*
#except-categories = *XXX*
#match-releases =
#except-releases =
#match-sites =
#except-sites =
#min-size =
max-size = 10GB

The [tracker] header

Your trackers require that you authenticate before letting you download a torrent file. Use the tracker headers to set the required options so downloads work.

A tracker header looks like [tracker TYPE] where TYPE is the tracker type. This is the exact same type that you find in the ~/.irssi/scripts/AutodlIrssi/trackers/*.tracker files. Open one of the files with a text editor and locate the type="XYZ" line. Use the value inside the quotes, eg. XYZ. Example: [tracker XYZ]. Case matters so XYZ is different from xyz.

Some trackers require a passkey, others an authkey, or a cookie, etc. To quickly find out which one your tracker needs, just add [tracker TYPE] (with no options below it) to autodl.cfg and wait 1-2 seconds (start Irssi if necessary). It will report the missing options, eg.: ERROR: /home/user/.autodl/autodl.cfg: line 123: TRACKER-TYPE: Missing option(s): passkey, uid. Here it's saying that you forgot to add the options passkey = XXX and uid = YYY. Add them below the tracker header.

Some common tracker options and how to get them:

cookie: Go to your tracker's home page, then type javascript:document.innerHTML=document.cookie in the address bar and press enter. You should now see your cookie. If all you see is PHPSESSID=XXXXX, then you'll have to manually get the cookie using FireFox: Edit -> Preferences -> Privacy tab -> Show Cookies. It's usually just uid=XXX; pass=YYY. Separate each key=value pair with a semicolon.

passkey: First check a torrent download link if it contains it. If not you can usually find it in the generated RSS-feed URL, which you probably can generate @ yourtracker.com/getrss.php . passkeys are usually exactly 32 characters long. The passkey can also sometimes be found in your profile (click your name).

authkey: See passkey above. For gazelle sites, it's part of the torrent download link.

torrent_pass: For gazelle sites, it's part of the torrent download link.

uid: Click your username and you should see the id=XXX in the address bar. That's your user id, or uid.

[tracker TYPE]
#enabled =
#force-ssl =
#upload-delay-secs =
#cookie =
#passkey =
#etc ...

enabled is optional and defaults to true. Set it to false to disable the tracker.
force-ssl is optional and can be set to true to force encrypted torrent downloads. Not all trackers support HTTPS downloads. Leave it blank for the default value (which is HTTP or HTTPS).
upload-delay-secs is optional and is the number of seconds autodl-irssi should wait before uploading/saving the torrent. Default is 0 (no wait). This option isn't needed 99.999% of the time.

And now for the tracker configuration in the autodl.cfg file.
Note: You will have to spend some of your own effort in filling these out. I have tried to be polite to the trackers and provide as little information as possible about them. Make sure to replace anything wrapped in <> with the appropriate information.
e.g. replace <Username> with simply Ted518 (Or whatever your actual username is), and replace <IRC Server> with the tracker's IRC server URL, for instance irc.freenode.net

What.CD

[tracker what]
authkey = <Thirty two alphanumeric characters found by following instructions above>
torrent_pass = <Thirty two alphanumeric characters found by following instructions above>
force-ssl = true
#upload-delay-secs =
enabled = true

[server <IRC Server>]
nick = <Username>|bot
ident-password = <The password to identify with NickServ>
ident-email = <The e-mail to use to register with NickServ if you are not already>
port = <IRC SSL Port>
ssl = true

[channel <IRC Server>]
name = #<name of the announce channel>
invite-command = <command used to enter the announce channel>

BTN

[tracker btn]
authkey = <Thirty two characters found by following instructions above>
torrent_pass = <Thirty two characters found by following instructions above>
force-ssl = true
#upload-delay-secs =
enabled = true

[server <IRC Server>]
nick = <Username>|bot
ident-password = <The password to identify with NickServ>
ident-email = <The e-mail to use to register with NickServ if you are not already>
port = <IRC SSL Port>
ssl = true

[channel <IRC Server>]
name = #<name of the announce channel>

SCC

Note: You will need to visit their support channel and request permission to use this script, as well as requesting a vhost for your bot.
[tracker scc]
authkey =
force-ssl = true
#upload-delay-secs =
enabled = true

[server <IRC Server>]
nick = Username-bot
ident-password = <The password to identify with NickServ>
ident-email = <The e-mail to use to register with NickServ if you are not already>
port = <IRC SSL Port>
ssl = true

[channel <IRC Server>]
name = #<name of the announce channel>
invite-http-data = announce=yes
invite-http-header = Cookie: uid=<Your UserID (Can be found in your profile's URL)>; pass=<Thirty two characters found in your cookie>
invite-http-url = https://<siteURL>/irc

Values

All lines starting with the # character are ignored (they're comments). Use it to disable some options.

The file contains several headers of the form [headername] and header options immediately below the header. The options are of the form option-name = option-value. If you leave out the value or option-name, then the default value will be used.

There are a few different option types: Comma separated list. eg. value1, value2, value3.
List of numbers. eg. 1980-1999, 2010, 2012
String. Any number of random characters.
Integer. Any integer.
Boolean. false, off, no, or 0 all mean "false". Anything else means "true".
Size. eg. 120 MB or 4.5GB

All option values are case-insensitive so eg. The Simpsons is the same thing as the siMPSonS.

The comma separated list type supports wildcards, where the * character means 0 or more characters, and the ? character means exactly one character. Google wildcards for more information. Example, simpsons will match any text with the word simpsons in it. It means First 0 or more characters, then "simpsons", then 0 or more characters. Note that simpsons* is not the same thing, it means First "simpsons" then 0 or more characters, so simpsons* will match anything that begins with the word "simpsons" followed by any text.

The filter header
Create one [filter] header per filter. You can optionally name the filter like [filter MY FILTER NAME]. All filter options are optional! If you don't use any filter options, then everything will be downloaded because your filter doesn't filter out anything.

Name: enabled
Type: Boolean
Default: true
Example: enabled = false
Description: Use it to disable a filter. All filters are enabled by default.

Name: match-releases
Type: Comma separated list
Example: match-releases = The?Simpsons*, American?Dad*
Description: It's compared against the torrent name, eg. Some.release.720p.HDTV-GROUP. If the filter should only match TV-shows or movies, it's easier to use the shows filter option since it doesn't require wildcards.

Name: except-releases
Description: The exact opposite of match-releases. If a release matches this option, then it's NOT downloaded.

Name: match-categories
Type: Comma separated list
Example: match-categories = MP3, TV/XVID
Description: It's compared against the torrent category.

Name: except-categories
Description: The exact opposite of except-categories. If a release matches this option, then it's NOT downloaded.

Name: match-sites
Type: Comma separated list
Example: match-sites = tracker1, tracker2, tracker3
Description: It's compared against the tracker. Use the full tracker name, eg. MyTracker or use one of the tracker types found in ~/.irssi/scripts/AutodlIrssi/trackers/*.tracker. Open one of the files and locate the type="XYZ" line. Use the value inside the quotes, eg. XYZ.

Name: except-sites
Description: The exact opposite of match-sites. If a release matches this option, then it's NOT downloaded.

Name: min-size
Type: Size
Example: min-size = 200MB
Default: 0
Description: Used to filter out too small torrents.

Name: max-size
Type: Size
Example: max-size = 2.5GB
Default: any size is allowed
Description: Used to filter out too big torrents. I recommend everyone to always use this option so you don't accidentally download a 100GB torrent! :D Set it to a reasonable value, eg. for TV-shows, set it to about twice the size of a normal episode (just in case it's a double-episode). This will automatically filter out season packs!

Name: shows
Type: Comma separated list
Example: shows = The Simpsons, American Dad
Description: This is for TV-shows, movies and artists/groups (what.cd/waffles only). autodl-irssi will automatically extract the TV-show/movie name from a scene release name. Example, The.Simpsons.S35E24.720p.HDTV-BLAH will match a shows option set to the simpsons. You don't need wildcards at all, though it's possible to use wildcards. It's recommended to use shows instead of match-releases if all you want is for the filter to match TV-shows or movies. what.cd and waffles: this will match against the artist/group.

Name: seasons
Type: List of numbers
Example: seasons = 1, 3, 5-10
Description: This is for TV-shows only. Unless the release matches one of the seasons, it's not downloaded.

Name: episodes
Type: List of numbers
Example: episodes = 1, 3, 5-10
Description: This is for TV-shows only. Unless the release matches one of the episodes, it's not downloaded.

Name: resolutions
Type: Comma separated list
Example: resolutions = SD, 720p, 1080p
Description: This is for TV-shows and movies only. Unless the release matches one of the resolutions, it's not downloaded. Valid resolutions are one or more of the following: SD, 480i, 480p, 576p, 720p, 810p, 1080i, 1080p.

Name: sources
Type: Comma separated list
Example: sources = HDTV, DVDRip, BluRay
Description: This is for TV-shows and movies only. Unless the release matches one of the sources, it's not downloaded. Valid sources are one or more of the following: DSR, PDTV, HDTV, HR.PDTV, HR.HDTV, DVDRip, DVDScr, BDr, BD5, BD9, BDRip, BRRip, DVDR, MDVDR, HDDVD, HDDVDRip, BluRay, WEB-DL, TVRip, CAM, R5, TELESYNC, TS, TELECINE, TC. TELESYNC and TS are synonyms (you don't need both). Same for TELECINE and TC.

Name: encoders
Type: Comma separated list
Example: encoders = x264, xvid
Description: If you don't want windows WMV files, this option could be useful. :) Valid encoders are: XviD, DivX, x264, h.264 (or h264), mpeg2 (or mpeg-2), VC-1 (or VC1), WMV.

Name: years
Type: List of numbers
Example: years = 1999, 2005-2010
Description: Not all releases have a year in the torrent name, but if it does, you can use it to filter out too old or too new releases.

Name: albums
Type: Comma separated list
Example: albums = Some album, Some other album, yet another one
Description: what.cd/waffles only.

Name: formats
Type: Comma separated list
Example: formats = MP3, FLAC
Description: what.cd/waffles only. List the formats you want. Valid formats are: MP3, FLAC, Ogg, AAC, AC3, DTS.

Name: bitrates
Type: Comma separated list
Example: bitrates = 192, V0 (vbr), lossless
Description: what.cd/waffles only. List the bitrates you want. Some example values: 192, 320, APS (VBR), V2 (VBR), V1 (VBR), APX (VBR), V0 (VBR), q8.x (VBR), Lossless, 24bit Lossless, Other.

Name: media
Type: Comma separated list
Example: media = CD, WEB
Description: what.cd/waffles only. List the media you want. Valid media are: CD, DVD, Vinyl, Soundboard, SACD, DAT, Cassette, WEB, Other.

Name: tags
Type: Comma separated list
Example: tags = hip hop, rock
Description: what.cd/waffles only. Unless at least one of your tags matches the release's tags, it's not downloaded. See also except-tags and tags-any.

Name: except-tags
Type: Comma separated list
Example: except-tags = hip hop, rock
Description: what.cd/waffles only. Same as tags except if it matches any/all of these, it's not downloaded. See also tags and except-tags-any.

Name: tags-any
Type: Boolean
Default: true
Example: tags-any = false
Description: what.cd/waffles only. Decides how to match the tags option, ie., if any or all of the tags must match.

Name: except-tags-any
Type: Boolean
Default: true
Example: except-tags-any = true
Description: what.cd/waffles only. Decides how to match the except-tags option, ie., if any or all of the tags must match.

Name: scene
Type: Boolean
Example: scene = true
Description: what.cd/waffles, and a few others. Some sites mark a release as scene or non-scene. Set it to true if you want only scene releases, false if you only want non-scene releases, or don't use this option if you don't care.

Name: log
Type: Boolean
Example: log = true
Description: what.cd/waffles. Set it to true if you only want releases with a log file, false if you don't want releases with log files, or don't use this option if you don't care.

Name: cue
Type: Boolean
Example: cue = true
Description: what.cd. Set it to true if you only want releases with a cue file, false if you don't want releases with cue files, or don't use this option if you don't care.

Name: match-uploaders
Type: Comma separated list
Example: match-uploaders = uploader1, uploader2
Description: Use it to only download from certain uploaders.

Name: except-uploaders
Description: The exact opposite of match-uploaders. If a release matches this option, then it's NOT downloaded.

Name: max-pretime
Type: time-since string
Example: max-pretime = 2 mins 3 secs
Description: Some sites announce the pretime of the release. Use this to filter out old releases.

Name: max-downloads
Type: Integer
Example: max-downloads = 15
Description: Download no more than this number of torrents per week/month (see max-downloads-per). Remove the filter option or set it to a negative number to disable it.

Name: max-downloads-per
Type: String
Example: max-downloads-per = week
Description: Valid values are day, week, and month. See max-downloads.

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.