manga-crawler
v0.7.0
Published
A lib for programmatic access to manga on diverse sources.
Downloads
27
Readme
Manga Crawler
A lib for programmatic access to manga on diverse sources.
Installation
npm i manga-crawler
Features
Feature | Mangakakalot | Manganato
-|-|-
search
| ✅ | ✅
fetchManga
| ✅ | ✅
fetchChapterPages
| ✅ | ✅
listMangas
| ✅ | ✅
Usage
search
search(name: string, source: string)
name
: Name of the manga to searchsource
: Name of the supported search source
import MangaCrawler from "manga-crawler"
const results = await MangaCrawler.search('naruto', 'mangakakalot')
Returned type:
Array<{
name: string, // Manga title
link: string, // Manga page link
thumbnail: string, // Cover link
source: string, // Manga source, since it may not be the same as the search source
}>
fetchManga
fetchManga(mangaLink: string, source: string)
mangaLink
: Link for the manga webpagesource
: Name of the supported source
import MangaCrawler from "manga-crawler"
const results = await MangaCrawler.fetchManga('https://chapmanganato.to/manga-ng952689', 'manganato')
Returned type:
{
summary: string, // Manga description
alternative_titles: Array<string>, // Alternative titles list
author?: string, // Author of the manga
status?: string, // Current manga status
genres: Array<string>, // Genres list of the manga
updated_at?: string, // Latest update date
views?: number, // Total views
chapters: Array<{
name: string // Chapter name
link: string, // Chapter link
created_at: string, // Post date of the chapter
views: number, // Total views
}>
}
fetchChapterPages
fetchChapterPages(chapterLink: string, source: string)
chapterLink
: Link for the chapter webpagesource
: Name of the supported source
import MangaCrawler from "manga-crawler"
const results = await MangaCrawler.fetchChapterPages('https://chapmanganato.to/manga-uo998171/chapter-1', 'manganato')
Returned type:
Array<{
encoded_page?: string, // Page image like the following: `data:image/jpeg;base64, ${encodedPage}`
number: number, // Number of the page
}>
listMangas
listMangas(source: string, opts: {})
source
: Name of the supported sourceopts
: Filter and sorting conditions
import MangaCrawler from "manga-crawler"
const results = await MangaCrawler.listMangas('mangakakalot', { page: 1 })
Returned type:
{
current_page: number, // Fetched page
last_page: number, // Final page
mangas: Array<{
name: string, // Manga title
link: string, // Manga page link
thumbnail: string, // Cover link
source: string, // Manga source, since it may not be the same as the search source
}>,
}