Table of Content
[TOC]
General
HakuNeko provides parsers to access mangas/animes from some selected websites.
Include the module:
var hakuneko = require( 'hakuneko' );
Mangas and animes sharing the same structures, but are slightly different in their meanings.
Chapters in a manga are equivalent to episodes in an anime.
Some fields will be left blank, because they are not necessary for an anime episode.
Pages in a chapter are equivalent to resolutions (qualities) for an anime episode.
Creating structures:
manga = hakuneko.base.createManga( 'Title', '/Manga/Mirai-Nikki', 'KissManga', [] );
chapter = hakuneko.base.createChapter( '[VOL]', '[NR]', 'Title', 'lang', 'scanlator', '/Manga/Mirai-Nikki/0?id=53068', [] );
page = hakuneko.base.createPage( '001', 'http://s.imgur.com/images/imgur-logo.svg' );
chapter.p.push( page );
manga.c.push( chapter );
console.log( manga );
anime = hakuneko.base.createAnime( 'Title', '/Anime/Mirai-Nikki', 'KissAnime', [] );
episode = hakuneko.base.createEpisode( '', '[NR]', 'Title', 'lang', '', '/Anime/Mirai-Nikki/0?id=53068', [] );
quality = hakuneko.base.createResolution( '480p', 'http://s.imgur.com/images/imgur-logo.svg' );
episode.p.push( quality );
anime.c.push( episode );
console.log( anime );
Structures / members:
Member | Manga | Anime |
---|
manga.m | Media type (always 'manga') | Media type (always 'anime') |
manga.o | Origin identifier (e.g. 'KissManga') | Origin identifier (e.g. 'KissAnime') |
manga.t | Title | Title |
manga.u | URL of origin | URL of origin |
manga.c | Chapter list (array) | Episode list (array) |
chapter.v | Chapter volume | - |
chapter.n | Chapter number | Episode number |
chapter.t | Chapter title | Episode title |
chapter.g | Chapter Scanlator group | - |
chapter.l | Chapter language | - |
chapter.u | URL of origin | URL of origin |
chapter.p | Page list (array) | Resolution list (array) |
page.n | Page number | Episode resolution identifier (e.g. '480p') |
page.u | URL to image | URL to video |
Example (JSON representation):
{
"m": "manga",
"t": "Title",
"u": "/Manga/Mirai-Nikki",
"o": "KissManga",
"c": [
{
"v": "[VOL]",
"n": "[NR]",
"t": "Title",
"l": "lang",
"g": "scanlator",
"u": "/Manga/Mirai-Nikki/0?id=53068",
"p": [
{
"n": "001",
"u": "http://s.imgur.com/images/imgur-logo.svg"
}
]
}
]
}
KissManga
Get Mangas
Function to parse mangas from the website.
Manga list is scattered over multiple website pages, where each page contains roughly 50 mangas.
- Parameter is a callback function, that will be executed for each manga (error and manga object will be relayed as parameters).
- Parameter is optional, the start page (website) that should be used [default=1].
- Parameter is optional, the end page (website) that should be used [default=9999].
hakuneko.kissmanga.getMangas( function( error, manga ) {
console.log( error, manga );
}, 1, 1 );
Get Chapters
Function to parse chapters from the website for the given manga.
The manga could be a result from the getPages function.
- Parameter is a callback function, that will be executed after all chapters have been acquired (error and chapters array will be relayed as parameters).
manga = hakuneko.base.createManga( 'Title', '/Manga/Mirai-Nikki', 'KissManga', [] );
hakuneko.kissmanga.getChapters( manga, function( error, chapters ) {
if( !error ) {
manga.c = chapters;
}
console.log( error, chapters );
});
Get Pages
Function to parse pages from the website for the given chapter.
The chapter could be a result from the getChapters function.
NOTE: Aggressive downloads will trigger a re-captcha riddle for your IP, so add a delay between multiple calls!
- Parameter is a callback function, that will be executed after all pages have been acquired (error and pages array will be relayed as parameters).
chapter = hakuneko.base.createChapter( '[VOL]', '[NR]', 'Title', 'lang', 'scanlator', '/Manga/Mirai-Nikki/0?id=53068', [] );
hakuneko.kissmanga.getPages( chapter, function( error, pages ){
if( !error ) {
chapter.p = pages;
}
console.log( error, pages );
});
KissAnime
NOTE: Website is region blocked, HakuNeko module will not work within blocked countries!
Get Animes
Function to parse animes from the website.
Anime list is scattered over multiple website pages, where each page contains roughly 50 animes.
- Parameter is a callback function, that will be executed for each anime (error and anime object will be relayed as parameters).
- Parameter is optional, the start page (website) that should be used [default=1].
- Parameter is optional, the end page (website) that should be used [default=9999].
hakuneko.kissanime.getAnimes( function( error, anime ) {
console.log( error, anime );
}, 1, 1 );
Get Episodes
Function to parse episodes from the website for the given anime.
The anime could be a result from the getAnimes function.
- Parameter is a callback function, that will be executed after all episodes have been acquired (error and episodes array will be relayed as parameters).
anime = hakuneko.base.createAnime( 'Title', '/Anime/RWBY', 'KissAnime', [] );
hakuneko.kissanime.getEpisodes( anime, function( error, episodes ) {
if( !error ) {
anime.c = episodes;
}
console.log( error, episodes );
});
Get Resolutions
Function to parse different resolutions (quality) from the website for the given episode.
The episode could be a result from the getEpisodes function.
NOTE: Aggressive downloads will trigger a re-captcha riddle for your IP, so add a delay between multiple calls!
NOTE: Video links may require 'http://kissanime.ru' as referer in HTTP header or a 404 error may occur!
- Parameter is a callback function, that will be executed after all resolutions have been acquired (error and resolutions array will be relayed as parameters).
episode = hakuneko.base.createEpisode( '', '[NR]', 'Title', '', '', '/Anime/RWBY/Episode-001?id=52422', [] );
hakuneko.kissanime.getResolutions( episode, function( error, resolutions ){
if( !error ) {
epsiode.p = resolutions;
}
console.log( error, resolutions );
});