Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
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' );
chapter = hakuneko.base.createChapter( '[VOL]', '[NR]', 'Title', 'lang', 'scanlator', '/Manga/Mirai-Nikki/0?id=53068', [] );
// add page to chapter
chapter.p.push( 'http://s.imgur.com/images/imgur-logo.svg' );
// dump manga and chapter
console.log( manga, chapter );
anime = hakuneko.base.createAnime( 'Title', '/Anime/Mirai-Nikki' );
episode = hakuneko.base.createEpisode( '', '[NR]', 'Title', 'lang', '', '/Anime/Mirai-Nikki/0?id=53068', [] );
// add quality/resolution to episode
episode.p.push( 'http://s.imgur.com/images/imgur-logo.mp4?q=720p' );
// dump anime and episode
console.log( anime, episode );
Manga Structure:
Member | Description (If Manga) | Description (If Anime) |
---|---|---|
manga.t | Title | Title |
manga.u | URL of origin | URL of origin |
Chapter Structure:
Member | Description (If Manga) | Description (If Anime) |
---|---|---|
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 |
JSON Example (Manga/Anime):
{
"t": "Title",
"u": "/Manga/Mirai-Nikki"
}
JSON Example (Chapter/Episode):
{
"v": "[VOL]",
"n": "[NR]",
"t": "Title",
"l": "lang",
"g": "scanlator",
"u": "/Manga/Mirai-Nikki/0?id=53068",
"p": [
"http://s.imgur.com/images/imgur-logo.svg"
]
}
Function to parse mangas from the website. Manga list is scattered over multiple website pages, where each page contains roughly 50 mangas.
hakuneko.kissmanga.getMangas( function( error, mangas ) {
console.log( error, mangas );
}, 1, 1 );
Function to parse chapters from the website for the given manga. The manga could be a result from the getMangas function.
manga = hakuneko.base.createManga( 'Title', '/Manga/Mirai-Nikki' );
hakuneko.kissmanga.getChapters( manga, function( error, chapters ) {
if( !error ) {
// do something with the chapters ...
}
console.log( error, chapters );
});
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!
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; // assign pages to chapter
}
console.log( error, pages );
});
NOTE: Website is region blocked, HakuNeko module will not work within blocked countries!
Function to parse animes from the website. Anime list is scattered over multiple website pages, where each page contains roughly 50 animes.
hakuneko.kissanime.getAnimes( function( error, animes ) {
console.log( error, animes );
}, 1, 1 );
Function to parse episodes from the website for the given anime. The anime could be a result from the getAnimes function.
anime = hakuneko.base.createAnime( 'Title', '/Anime/RWBY' );
hakuneko.kissanime.getEpisodes( anime, function( error, episodes ) {
if( !error ) {
// do something with episodes ...
}
console.log( error, episodes );
});
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!
episode = hakuneko.base.createEpisode( '', '[NR]', 'Title', '', '', '/Anime/RWBY/Episode-001?id=52422', [] );
hakuneko.kissanime.getResolutions( episode, function( error, resolutions ){
if( !error ) {
epsiode.p = resolutions; // assign resolutions to episode
}
console.log( error, resolutions );
});
FAQs
Scraper for manga websites
The npm package hakuneko receives a total of 239 weekly downloads. As such, hakuneko popularity was classified as not popular.
We found that hakuneko demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.