A package to scrape images of manga chapters from mangaonline.biz.
npmjs/manga-web-scripting-fabio
To install the package, run:
npm i manga-web-scripting-fabio
Example configuration using "type": "module":
{
"name": "my-project",
"version": "1.0.0",
"main": "server.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"manga-web-scripting-fabio": "^1.2.0"
}
}
import { scrapeImages } from 'manga-web-scripting-fabio';
(async () => {
try {
const anime = 'naruto';
const chapter = 1;
const images = await scrapeImages(anime, chapter);
console.log('Scraped images:', images);
} catch (error) {
console.error('Error:', error.message);
}
})();
This documentation describes the video scraping functionality implemented in the project. The scrapeVideos
function is responsible for extracting the video link from an anime episode page.
The scrapeVideos
function makes an HTTP request to the episode page of an anime and extracts the video link embedded in the iframe
on the page.
Parameters:
anime
(string): The name of the anime to be scraped.ep
(number): The episode number from which the video should be extracted.
Returns:
Promise<string>
: Returns a promise that resolves with the video URL if found. Otherwise, it throws an error.
Usage Example:
import { scrapeVideos } from 'manga-web-scripting-fabio';
(async () => {
try {
const anime = 'naruto-shippuden';
const ep = 1; // Episode number
const videoUrl = await scrapeVideos(anime, ep);
console.log("Video URL: ", videoUrl);
} catch (error) {
console.error('Error:', error.message);
}
})();