wan

Automatically downloads new episodes of specified shows from NyaaTorrents.

Script

#!/bin/sh

if [ $# -eq 0 ]; then
    rssdler -o
    cd $HOME/Videos/Anime
    for i in */; do
        if [ -d "$i.torrents" ] && [ "$(ls "$i.torrents")" ]; then
            cd "$i".torrents
            (aria2c -d .. *.torrent >/dev/null; rm *.torrent) &
            cd ../..
        fi
    done
else
    echo '
['$*']
link = http://www.nyaa.se/?page=rss&term=[HorribleSubs]+'$(echo $* | sed 's/ /+/g')'+[720p]
directory = '$HOME'/Videos/Anime/'$*'/.torrents' \
    >>$HOME/.rssdler/config.txt
    mkdir -p "$HOME/Videos/Anime/$*/.torrents"
fi

Usage

wan [SHOW]

wan depends on aria2 and rssdler.

  1. Create an (almost) empty rssdler config: (skip this if you already have one — this will overwrite it)
  2. $ echo '[global]' > $HOME/.rssdler/config.txt
        
  3. Add shows:
  4. $ wan Gatchaman Crowds Insight
    $ wan Non Non Biyori Repeat
        
  5. Check for new episodes and start downloading them:
  6. $ wan
        
  7. wan will download 720p HorribleSubs (you can change the resolution and subtitle group on line 15) episodes using the following directory structure:
  8. $HOME/Videos/Anime/
    ├── Gatchaman Crowds Insight
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 01 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 02 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 03 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 04 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 05 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 06 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 07 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 08 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 09 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 10 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 11 [720p].mkv
    │   ├── [HorribleSubs] Gatchaman Crowds Insight - 12 [720p].mkv
    │   └── .torrents
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 01 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 02 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 03 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 04 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 05 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 06 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 07 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 08 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 09 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 10 [720p].mkv.torrent
    │       ├── [HorribleSubs] Gatchaman Crowds Insight - 11 [720p].mkv.torrent
    │       └── [HorribleSubs] Gatchaman Crowds Insight - 12 [720p].mkv.torrent
    └── Non Non Biyori Repeat
        ├── [HorribleSubs] Non Non Biyori Repeat - 01 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 02 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 03 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 04 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 05 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 06 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 07 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 08 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 09 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 10 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 11 [720p].mkv
        ├── [HorribleSubs] Non Non Biyori Repeat - 12 [720p].mkv
        └── .torrents
            ├── [HorribleSubs] Non Non Biyori Repeat - 01 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 02 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 03 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 04 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 05 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 06 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 07 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 08 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 09 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 10 [720p].mkv.torrent
            ├── [HorribleSubs] Non Non Biyori Repeat - 11 [720p].mkv.torrent
            └── [HorribleSubs] Non Non Biyori Repeat - 12 [720p].mkv.torrent
    
    
  9. (optional) Add a cronjob to run wan and download new episodes periodically:
  10. $ crontab -e
    
    # m h  dom mon dow   command
      0 *  *   *   *     wan
        

License

Distributed under the ISC license.

Disclaimer

Using wan is probably illegal where you live, so don't.