Skip to content

Repository files navigation

Animeman

Release Tests

Animeman is a service for synchronizing your anime list currently watching with Nyaa and QBittorrent.
Currently it manages qBittorrent through it's WebUI, creating and managing a category of torrents.
It automatically parses the torrent titles for tagging the show, season and episodes, while also searching in Nyaa.si for new releases.

Features

  • Automatic Downloads weekly releases from your WatchList
  • Downloads batch releases: from complete series from your WatchList
  • Tags: all torrent entries under the configured category with [!Serie name, Serie name S01E01] as an example
  • Source and quality filter: you can specify resolution and HEVC tag
  • Smart episode detection: you don't need to worry about downloading the same episode twice
  • Custom torrent renaming logic: you are able to write exactly how your torrents should be named using expr-lang

How does it work?

  1. Tag existing torrents in the configured category in qBittorrent
  2. Fetch your Currently Watching entries from MAL or Anilist
  3. Search Nyaa.si for episodes for each anime list entry
  4. Scan through results searching for newer episodes than the existing ones in qBittorrent
    It doesn't search for specific episodes, it uses all results from a single page to retrieve new episodes.
    This might not work well for shows with more episodes than nyaa.si page size.
    Changing this approach is not viable at the moment, as it would require Animeman more requests about each episode information.
  5. Add torrent to qBittorrent via the WebUI API

The purpose of this tool is to download the latest RSS entry for each episode. It prioritizes the highest provided quality, respecting your filter. If there are multiple sources for the same quality, it should choose the one with the highest number of seeders.

Configuration

Animeman will generate a boilerplate config for the first time.
You can set your own config path with the env CONFIG_PATH.

# config.yaml
logLevel: info # (debug,info,error).
animeList:
  type: myanimelist # (myanimelist|anilist).
  username: YOUR_USERNAME # Replace with your username.
rssConfig:
  type: nyaa
  pollFrequency: 5m0s # Minimum 1m0s. Avoids denial-of-service on nyaa.
  sources: # Specify which sources to use, and in which priority. Keep empty to accept all.
      - source1
      - source2
  qualities: # OR filter. Example 1080 HEVC or 720
      - 1080 HEVC
      - 720
  searchSuffix: '-"dub"' # Specifies search suffixes like negative match on keywords.
  customParameters: # Configures custom query parameters for the rss list call.
    c: 1_2 # Defines english only anime sources.
    s: seeders # Sorts by seeders, keep most seeded candidates on first page.
    o: desc # Descending order.
torrentConfig:
  type: qbittorrent
  category: Animes # Animeman managed category, will be used to create tags / identify latest ep.
  downloadPath: /downloads/animes
  createShowFolder: true # Creates a folder to for the show inside downloadPath.
  renameTorrent: true # Rename the torrent in qBittorrent avoiding conflict between multiple sources with different names for the show.
  renameScript: "" # An expr-lang script that allows you to define how you want your torrents to be named.
  host: http://ip:port # Replace with your qBittorrent WebUI address.
  username: admin # Replace credentials with your own
  password: adminadmin

Docs for renameScript

Language builtins are found under expr-lang.
Available envs: [title, releaseGroup, labels, tag, verticalResolution].
Available funcs:

  • format("mask", value): Use format masks like %s or %v, to render a value. Returns empty string on zero value

Example 1

// Joins parts with a single space.
join(
  // Filters only non-empty parts.
  filter(
    [
      // Put release group inside square brackets if any.
      format("[%s]", releaseGroup),
      title,
      // Format tag as a string. e.g. S1E4.
      tag.String(), 
      // Put vertical resolution inside square brackets + p, if any.
      format("[%dp]", verticalResolution),
      // Format array of labels as [v1,v2,v3...]. 
      format("%v", labels),
    ], 
    # != "",
  ), 
  " ",
)

This script formats torrents as: [release-group] My Anime Title S1E1 [1080p] [HEVC 10BIT]

Installation

Download

You can download the latest release here.
You can run a first time for generating a boilerplate config, then you configure your config.yaml.

Linux CLI

Simply run CONFIG_PATH=./config.yaml ./animeman

Windows

Simply run animeman.exe on the cmd.

Docker

Support for linux/amd64 and linux/arm64.

docker run -it -e CONFIG_PATH=/config/config.yaml -v ./config:/config ghcr.io/sonalys/animeman:latest

Docker Compose

# docker-compose.yaml
version: "2.1"
services:
  animeman:
    image: ghcr.io/sonalys/animeman:latest
    container_name: animeman
    environment:
      - CONFIG_PATH=/config/config.yaml
    volumes:
      - ./config:/config

docker compose -f docker-compose.yaml up -d animeman

Building

Dependencies

You will need at least go 1.27 for building the binary.
For the image you will need docker.
To build you can simply run make build
For the image you can run make image

Roadmap

There are a couple things that will be iterated:

  • Improve interfaces for allowing other RSS feeds

Contribution

Feel free to fork and open pull requests
Tests or roadmap features are very welcome, thanks.

Disclaimer

This tool is intended as a proof-of-concept, and is not intended for any illegal activities.

About

A proof-of-concept for synchronizing your anime watchlist with your torrents

Topics

Resources

Stars

26 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages