5.4.0 • Published 4 months ago

anitomy-js v5.4.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 months ago

anitomy-js

Actions Status GitHub license

anitomy-js is a Node.js wrapper for Anitomy - a C++ library for parsing anime video filenames.

Requirements

  • Linux: gcc/g++ >= 5
  • Windows: Visual Studio >= 2015 (With C++ build tools)
  • Mac OS >= 10.9 (with Xcode installed, of course)

Installation

With npm do:

npm install anitomy-js

anitomy-js builds it's dependencies upon installation. Please refer to the node-gyp documentation if you're having problems with the build.

Version 1.x

Starting with version 1.0 the minimum supported Node version is 0.12

Changes from version 2.x

Starting with version 2.0, anitomy-js requires C++ 14 and at least Node 4:

  • Linux: GCC/G++ >= 5
  • Windows: Visual Studio >= 2015
  • Mac OS >= 10.9

If you can't update your build tools, all versions from 1.x are compatible with C++ 11.

Changes from version 3.x

Starting with version 3.0 the old callback style with a single argument is deprecated. You should switch to either use the Promise API or a node style callback (err, data). The minimum supported Node version is 6.

Changes from version 4.x

4.x is a complete rewrite from scratch and requires at least Node 8. The old callback style API was completely removed and now the async methods (parse and parseAsync) exposes only the Promise API.

Changes from version 5.x

On version 5.x, anitomy-js switched from using NAN, to the newer NAPI. With this change, all context-related issues should be fixed.

Usage

anitomy-js provides two methods: parse and parseSync. Both methods accept single filename input or an array of filenames for batch parsing.

Additionally you can pass an object as the last parameter to change Anitomy's original parsing options. The options are:

  • allowed_delimiters - defaults to " _.&+,|"
  • ignored_strings - defaults to []
  • parse_episode_number - defaults to true
  • parse_episode_title - defaults to true
  • parse_file_extension - defaults to true
  • parse_release_group - defaults to true

parse(data, options) -> Promise\<AnitomyResult | AnitomyResult[]>

var anitomy = require('anitomy-js')
anitomy
  .parse('[tlacatlc6] Natsume Yuujinchou Shi Vol. 1v2 & Vol. 2 (BD 1280x720 x264 AAC)')
  .then((data) => console.log(data))

... would be parsed into

{
  "anime_title": "Natsume Yuujinchou Shi",
  "audio_term": "AAC",
  "file_name": "[tlacatlc6] Natsume Yuujinchou Shi Vol. 1v2 & Vol. 2 (BD 1280x720 x264 AAC)",
  "release_group": "tlacatlc6",
  "release_version": "2",
  "source": "BD",
  "video_term": "x264",
  "video_resolution": "1280x720",
  "volume_number": ["1", "2"]
}

parseSync(data, options) -> AnitomyResult | AnitomyResult[]

var anitomy = require('anitomy-js')
var filenames = [
  '[DmonHiro] Magi - The Labyrinth Of Magic - Vol.1v2 (BD, 720p)',
  '[KLF]_D.Gray-man_04V2.avi',
]
console.log(anitomy.parseSync(filenames))

... would be parsed into

[
  {
    "anime_title": "Magi - The Labyrinth Of Magic",
    "file_name": "[DmonHiro] Magi - The Labyrinth Of Magic - Vol.1v2 (BD, 720p)",
    "release_group": "DmonHiro",
    "release_version": "2",
    "source": "BD",
    "video_resolution": "720p",
    "volume_number": "1"
  },
  {
    "anime_title": "D.Gray-man",
    "episode_number": "04",
    "file_extension": "avi",
    "file_name": "[KLF]_D.Gray-man_04V2",
    "release_group": "KLF",
    "release_version": "2"
  }
]

License

Licensed under the incredibly permissive MIT license

5.4.0

4 months ago

5.3.0

4 months ago

5.2.0

4 months ago

5.1.0

2 years ago

5.0.0

4 years ago

4.0.4

4 years ago

4.0.3

4 years ago

4.0.2

4 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.0.9

7 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago