All Projects → erengy → Anitomy

erengy / Anitomy

Licence: mpl-2.0
Anime video filename parser

Labels

Projects that are alternatives of or similar to Anitomy

Mangaki
Site de recommandation de mangas et d'anime
Stars: ✭ 118 (-30.59%)
Mutual labels:  anime
Malgraph4
MALgraph: statistics service for MyAnimeList.net users.
Stars: ✭ 143 (-15.88%)
Mutual labels:  anime
Kitsu Web
🔥 Ember.js app for Kitsu
Stars: ✭ 158 (-7.06%)
Mutual labels:  anime
Onepiece Kg
a knowledge graph project for ONEPIECE /《海贼王》知识图谱
Stars: ✭ 123 (-27.65%)
Mutual labels:  anime
Deepcreampy
Decensoring Hentai with Deep Neural Networks
Stars: ✭ 10,822 (+6265.88%)
Mutual labels:  anime
Kitsu Server
🚂 Rails API server for Kitsu
Stars: ✭ 145 (-14.71%)
Mutual labels:  anime
Yolo V3 Iou
YOLO3 动漫人脸检测 (Based on keras and tensorflow) 2019-1-19
Stars: ✭ 116 (-31.76%)
Mutual labels:  anime
Awesome Anime Sources
A curated list of everything anime.
Stars: ✭ 164 (-3.53%)
Mutual labels:  anime
Android App
Official LISTEN.moe Android app
Stars: ✭ 134 (-21.18%)
Mutual labels:  anime
Transfer Learning Anime
Transfer Learning for Anime Characters Recognition
Stars: ✭ 155 (-8.82%)
Mutual labels:  anime
Anirip
🎬 A Crunchyroll show/season ripper
Stars: ✭ 127 (-25.29%)
Mutual labels:  anime
Awesomeanimeresearch
Papers, repository or other data about anime or manga research. Please let me know if you know information which the list don't include.
Stars: ✭ 127 (-25.29%)
Mutual labels:  anime
Android App
An android application for reading novels
Stars: ✭ 146 (-14.12%)
Mutual labels:  anime
Cloudstream 2
CloudStream 2 is an android streaming app for movies, tv-shows and anime
Stars: ✭ 120 (-29.41%)
Mutual labels:  anime
Waifu Motivator Plugin
OSS Waifu Motivator Plugin for Jetbrains to help boost your motivation while coding!
Stars: ✭ 160 (-5.88%)
Mutual labels:  anime
Anime Face Detector
A Faster-RCNN based anime face detector implementation using tensorflow.
Stars: ✭ 117 (-31.18%)
Mutual labels:  anime
Doki Theme Jetbrains
Code with your waifu! Here are a bunch of themes for your JetBrains IDEs. Choose a girl from various anime series, manga, and visual novels such as: Re:Zero, KillLaKill and Doki-Doki Literature Club.
Stars: ✭ 143 (-15.88%)
Mutual labels:  anime
Animated Number Vue
Super easy way to animate numbers.
Stars: ✭ 170 (+0%)
Mutual labels:  anime
Anime Face Gan Keras
A DCGAN to generate anime faces using custom mined dataset
Stars: ✭ 161 (-5.29%)
Mutual labels:  anime
Streaming
r/freemediaheckyeah
Stars: ✭ 147 (-13.53%)
Mutual labels:  anime

Anitomy

Anitomy is a C++ library for parsing anime video filenames. It's accurate, fast, and simple to use.

Examples

The following filename...

[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv

...is resolved into these elements:

  • Release group: TaigaSubs
  • Anime title: Toradora!
  • Anime year: 2008
  • Episode number: 01
  • Release version: 2
  • Episode title: Tiger and Dragon
  • Video resolution: 1280x720
  • Video term: H.264
  • Audio term: FLAC
  • File checksum: 1234ABCD

Here's an example code snippet...

#include <iostream>
#include <anitomy/anitomy.h>

int main() {
  anitomy::Anitomy anitomy;
  anitomy.Parse(L"[Ouroboros]_Fullmetal_Alchemist_Brotherhood_-_01.mkv");

  const auto& elements = anitomy.elements();

  // Elements are iterable, where each element is a category-value pair
  for (const auto& element : elements) {
    std::wcout << element.first << '\t' << element.second << '\n';
  }
  std::wcout << '\n';

  // You can access values directly by using get() and get_all() methods
  std::wcout << elements.get(anitomy::kElementAnimeTitle) << L" #" <<
                elements.get(anitomy::kElementEpisodeNumber) << L" by " <<
                elements.get(anitomy::kElementReleaseGroup) << '\n';

  return 0;
}

...which will output:

12      mkv
13      [Ouroboros]_Fullmetal_Alchemist_Brotherhood_-_01
7       01
2       Fullmetal Alchemist Brotherhood
16      Ouroboros

Fullmetal Alchemist Brotherhood #01 by Ouroboros

How does it work?

Suppose that we're working on the following filename:

"Spice_and_Wolf_Ep01_[1080p,BluRay,x264]_-_THORA.mkv"

The filename is first stripped off of its extension and split into groups. Groups are determined by the position of brackets:

"Spice_and_Wolf_Ep01_", "1080p,BluRay,x264", "_-_THORA"

Each group is then split into tokens. In our current example, the delimiter for the enclosed group is ,, while the words in other groups are separated by _:

"Spice", "and", "Wolf", "Ep01", "1080p", "BluRay", "x264", "-", "THORA"

Note that brackets and delimiters are actually stored as tokens. Here, identified tokens are omitted for our convenience.

Once the tokenizer is done, the parser comes into effect. First, all tokens are compared against a set of known patterns and keywords. This process generally leaves us with nothing but the release group, anime title, episode number and episode title:

"Spice", "and", "Wolf", "Ep01", "-"

The next step is to look for the episode number. Each token that contains a number is analyzed. Here, Ep01 is identified because it begins with a known episode prefix:

"Spice", "and", "Wolf", "-"

Finally, remaining tokens are combined to form the anime title, which is Spice and Wolf. The complete list of elements identified by Anitomy is as follows:

  • Anime title: Spice and Wolf
  • Episode number: 01
  • Video resolution: 1080p
  • Source: BluRay
  • Video term: x264
  • Release group: THORA

Why should I use it?

Anime video files are commonly named in a format where the anime title is followed by the episode number, and all the technical details are enclosed within brackets. However, fansub groups tend to use their own naming conventions, and the problem is more complicated than it first appears:

  • Element order is not always the same.
  • Technical information is not guaranteed to be enclosed.
  • Brackets and parentheses may be grouping symbols or a part of the anime/episode title.
  • Space and underscore are not the only delimiters in use.
  • A single filename may contain multiple delimiters.

There are so many cases to cover that it's simply not possible to parse all filenames solely with regular expressions. Anitomy tries a different approach, and it succeeds: It's able to parse tens of thousands of filenames per second, with great accuracy.

The following projects make use of Anitomy:

See other repositories for related projects (e.g. interfaces, ports, wrappers).

Are there any exceptions?

Yes, unfortunately. Anitomy fails to identify the anime title and episode number on rare occasions, mostly due to bad naming conventions. See the examples below.

Arigatou.Shuffle!.Ep08.[x264.AAC][D6E43829].mkv

Here, Anitomy would report that this file is the 8th episode of Arigatou Shuffle!, where Arigatou is actually the name of the fansub group.

Spice and Wolf 2

Is this the 2nd episode of Spice and Wolf, or a batch release of Spice and Wolf 2? Without a file extension, there's no way to know. It's up to you consider both cases.

Suggestions to fansub groups

Please consider abiding by these simple rules before deciding on your naming convention:

  • Don't enclose anime title, episode number and episode title within brackets. Enclose everything else, including the name of your group.
  • Don't use parentheses to enclose release information; use square brackets instead. Parentheses should only be used if they are a part of the anime/episode title.
  • Don't use multiple delimiters in a single filename. If possible, stick with either space or underscore.
  • Use a separator (e.g. a dash) between anime title and episode number. There are anime titles that end with a number, which creates ambiguity.
  • Indicate the episode interval in batch releases.

License

Anitomy is licensed under Mozilla Public License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].