Tokyo Toshokan Downloader

Since I'm watching anywhere between 10-15 anime that are currently airing, I have to keep checking the toshokan website regularly everyday to see when the new shows get subtitled. This is fine, but sometimes I'm not able to check and I end up with a backlog of torrents that need to be downloaded as well as going through several pages to fine the shows that I'm watching. So I wrote a small java program that logs onto rizon and joins the #tokyotoshokan channel and listen for broadcasts made by the TT-RSS bot of the new releases, parses this information and checks the release info against a set of patterns that I have setup. Basically, you need a torrent program (I have Azureus) that monitors a directory for new torrent files and automatically downloads whatever is there, and you need a command line HTTP client (i use wget). You need to tell the program where the torrent directory is and if you're not using wget, what program (and what flags to pass to the program) you are using. Other than that, the only other flag you may need is a nick. This is the help that gets printed out:
Synopsis: java org.jonlin.TokyoToshokanIRCBot 
  -nick <nickname>       This is the nick that the bot will use on the IRC server.
                         You must be sure to use one that hasn't already been taken,
                         otherwise the bot will not be able to join the channel.
  -channel <irc channel> The irc channel to join. This is typically #tokyotosho.
  -server <hostname>     This is the irc server to connect to. This is typically
  -port <port>           This is the port to connect to. This is typically between 6666-6669.
  -user <username>       The irc username to log into the server,
                         typically <name> <your hostname> <your fullhostname> :<irc name>
                         example: joe laptop laptop.mynetwork :joe_bot
  -pong <hostname>       The reply to use when pinged by the server,
                         typically your hostname. Example:
  -rss <bot name>        This is the name of the bot in the channel that reports all the new
                         entries. These entries will be scanned and if there is a match, the
                         torrent will be downloaded.
  -all                   This will make it so all types of releases are checked, and not just
                         the English language anime releases. This includes [Manga], [Non-English],
                         [Hentai], [Music], [Music-Videos], [Raws], and [Other]
  -downloader <program>  This is the name of the program to use when a torrent needs to be
                         downloaded. This is typically wget, but can be any program that can
                         be invoked on the command line and given a URL as a parameter.
  -flags <program flags> This is the flags to pass to the downloader program. This can include
                         the pattern '{file}' which will be replaced with the torrent filename.
                         Example to use with wget: -O {file}
  -patterns <file>       This is the file to store the patterns used to see if there's a torrent
                         being posted is one that you want to download. Patterns should be separated
                         by lines. Each line can contain multiple patterns separated by commas.
                         If all the patterns in one line matches a torrent name, then that torrent
                         will be downloaded. Patterns that start with a ^ are ones that MUST NOT
                         match. These patterns are case insensitive.
                         Example of a patterns file:
  -torrents <directory>  The directory for where the torrents that have been downloaded are to be
                         placed. This is typically the directory that your torrent program scans
                         for new torrents. Make sure that there is a trailing directory separator
                         at the end (/ for *nix, \ for windows).
  -listen <port>         This will open a web interface on your localhost in order to give you the
                         ability to add and remove patterns as well as show you the list of recently
                         downloaded torrents. Without this flag, the web interface will not be
                         started. You can access the web interface only from the same computer you
                         are running the TokyoToshokanIRCBot on by going to http://localhost:<port>/
  -listenall             This flag causes the TokyoToshokanIRCBot to bind on all interfaces, and not
                         just localhost. This allows you to connect to the web interface from any
                         computer, instead of only the computer you are running this on. The -listen
                         MUST be set otherwise this flag is meaningless. Beware: If your computer is
                         visible from the internet, ANYONE can connect to the web interface and change
                         your match patterns.
  -email <email address> This is the email address to notify of when new torrents are downloaded.
                         No verification is done on the address itself, so make sure it is correct.
  -relay <mail host>     This is the email relay to use to send email. Typically, this is the same
                         server that you use in the 'Outgoing SMTP' field in your mail client. You
                         need to have send priviledges on the email relay from the computer you are
                         running this on, this bot will not attempt to authenticate with the email
                         relay. You need to have this and the -email flags set in order for email
                         notification to work.
  -debug                 This flag will cause the Toshokan bot to output debugging messages.
  -h or -help            Prints this help message.

If you use the -listen flag and a port number, you'll be able to access the web interface through http://localhost:<port>/, and if you use the -email and -relay flags, you'll get email notification. Here are a few screenshots:
Web Interface top
Web Interface bottom

JAR file
java source file

Filed under: Computers