New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hakuneko

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hakuneko - npm Package Compare versions

Comparing version 0.2.132 to 0.4.0

dist/hakuneko.js

38

package.json
{
"name": "hakuneko",
"version": "0.2.132",
"description": "Scraper for manga and anime websites",
"main": "hakuneko.js",
"version": "0.4.0",
"description": "Scraper for manga websites",
"main": "dist/hakuneko.js",
"files": [
"/dist",
"Readme.md"
],
"dependencies": {
"cheerio": "",
"crypto-js": "",
"entities": "",
"oauth-1.0a": "",
"request": ""
"cheerio": "latest",
"crypto-js": "latest",
"logtrine": "latest",
"request": "latest"
},
"devDependencies": {},
"devDependencies": {
"javascript-obfuscator": "latest",
"mocha": "latest",
"webpack": "latest",
"webpack-cli": "latest"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha",
"clean": "rm -r -f build dist",
"obfuscate": "javascript-obfuscator ./build/hakuneko.js --output ./dist/hakuneko.js --target node --self-defending true --control-flow-flattening true --control-flow-flattening-threshold 1 --dead-code-injection true --dead-code-injection-threshold 1 --string-array true --string-array-encoding rc4 --string-array-threshold 1",
"build": "npm run clean; webpack; npm run obfuscate"
},
"author": "Ronny Wegener",
"license": "MIT",
"license": "Unlicense",
"repository": {

@@ -23,3 +34,2 @@ "type": "git",

},
"homepage": "http://",
"keywords": [

@@ -31,7 +41,5 @@ "hakuneko",

"manga",
"anime",
"kissmanga",
"kissanime",
"vrv"
"mangago"
]
}

@@ -6,79 +6,34 @@ # Table of Content

- [Get Mangas](#get-mangas)
- [Get Chapters](#get-chapters)
- [Get Pages](#get-pages)
- [KissAnime](#kissanime)
- [Get Animes](#get-animes)
- [Get Episodes](#get-episodes)
- [Get Resolutions](#get-resolutions)
- [MangaGo](#kissmanga)
- [Get Mangas](#get-mangas)
# General
HakuNeko provides parsers to access mangas/animes from some selected websites.
HakuNeko provides parsers to access mangas from some selected websites.
Include the module:
```javascript
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:
```javascript
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 );
// [optional] use a logtrine logger in case for debug output
const { FileLogger } = require('logtrine');
const { KissManga, MangaGo } = require('hakuneko');
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 );
var logger = new FileLogger('./hakuneko.log', ConsoleLogger.LEVEL.All);
var kissmanga = new KissManga(logger);
var mangago = new MangaGo(logger);
```
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):
Basic data structure for manga(s):
```json
{
"t": "Title",
"u": "/Manga/Mirai-Nikki"
"id": "/Manga/Mirai-Nikki",
"title": "Mirai Nikki"
}
```
JSON Example (Chapter/Episode):
Basic data structure for chapter(s):
```json
{
"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"
]
"id": "/Manga/Mirai-Nikki/ch-001",
"title": "Chapter 01 - Beginning"
}

@@ -95,49 +50,15 @@ ```

**NOTE:** Website will ban your IP when using this module, only use it if you have dynamic IP!
Function to parse mangas from the website.
Manga list is scattered over multiple website pages, where each page contains roughly 50 mangas.
The manga list is scattered over multiple website pages, where each page contains roughly 50 mangas.
1. Parameter is a *callback* function, that will be executed after all mangas have been acquired (error and mangas array will be relayed as parameters).
2. Parameter is optional, the *start page* (website) that should be used [default=1].
3. Parameter is optional, the *end page* (website) that should be used [default=9999].
4. Parameter is internal, the *manga list* stack that will be filled incrementally while parsing pages.
1. Parameter is optional, the *start page* (website) that should be used [default=1].
2. Parameter is optional, the *end page* (website) that should be used [default=autodetect].
```javascript
hakuneko.kissmanga.getMangas( function( error, mangas ) {
console.log( error, mangas );
}, 1, 1 );
const { KissManga } = require('hakuneko');
var scraper = new KissManga();
let mangas = await scraper.getMangas(1, 2);
```
### Get Chapters
Function to parse chapters from the website for the given manga.
The manga could be a result from the *getMangas* function.
1. Parameter is a *callback* function, that will be executed after all chapters have been acquired (error and chapters array will be relayed as parameters).
```javascript
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 );
});
```
### 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!
1. Parameter is a *callback* function, that will be executed after all pages have been acquired (error and pages array will be relayed as parameters).
```javascript
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 );
});
```
[back to top](#table-of-content)

@@ -147,59 +68,21 @@

# KissAnime
# MangaGo
**NOTE:** Website is region blocked, HakuNeko module will not work within blocked countries!
### Get Mangas
### Get Animes
**NOTE:** Website will ban your IP when using this module, only use it if you have dynamic IP!
Function to parse animes from the website.
Anime list is scattered over multiple website pages, where each page contains roughly 50 animes.
Function to parse mangas from the website.
The manga list is scattered over multiple website pages, where each page contains roughly 44 mangas.
1. Parameter is a *callback* function, that will be executed after all animes have been acquired (error and animes array will be relayed as parameters).
2. Parameter is optional, the *start page* (website) that should be used [default=1].
3. Parameter is optional, the *end page* (website) that should be used [default=9999].
4. Parameter is internal, the *anime list* stack that will be filled incrementally while parsing pages.
1. Parameter is optional, the *start page* (website) that should be used [default=1].
2. Parameter is optional, the *end page* (website) that should be used [default=autodetect].
```javascript
hakuneko.kissanime.getAnimes( function( error, animes ) {
console.log( error, animes );
}, 1, 1 );
const { MangaGo } = require('hakuneko');
var scraper = new MangaGo();
let mangas = await scraper.getMangas(1, 2);
```
### Get Episodes
Function to parse episodes from the website for the given anime.
The anime could be a result from the *getAnimes* function.
1. Parameter is a *callback* function, that will be executed after all episodes have been acquired (error and episodes array will be relayed as parameters).
```javascript
anime = hakuneko.base.createAnime( 'Title', '/Anime/RWBY' );
hakuneko.kissanime.getEpisodes( anime, function( error, episodes ) {
if( !error ) {
// do something with 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!
1. Parameter is a *callback* function, that will be executed after all resolutions have been acquired (error and resolutions array will be relayed as parameters).
```javascript
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 );
});
```
[back to top](#table-of-content)
---
---
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc