npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zerobyw-dl

v1.5.1

Published

Yet another batch downloader for zerobyw

Downloads

10

Readme

zerobyw-dl

npm license size

Yet another batch downloader for zerobyw.

This library is not for browsers.

:star2: Features

  • CLI tools
  • Chapter list
  • Download as ZIP/CBZ, or just a folder of pictures
  • Downloading progress watch
  • Generates ComicInfo.xml

:framed_picture: Gallery

List of chapters

List of chapters

Downloading

Downloading

:green_book: Quick Start

You need Node.js (LTS or the current version) to run this project.

npm i zerobyw-dl
# or
# CLI
npx zerobyw-dl help

:wrench: Cli

Usage: zerobyw-dl [options] [command]

Commands:
  chapter, c, ch   Download images from one chapter.
  download, d, dl  Download chapters from a manga serie.
  help             Display help
  list, l, ls      List all chapters of a manga serie.
  version          Display version

Options:
  -a, --archive           Optional: Output zip or cbz archive grouped by chapters.
  -b, --batch             Optional: Set the number or images to be downloaded simultaneously, default to 10.
  -C, --chapters          Optional: Only downloading given list of chapters, example: -C 1,2,4,7
  -c, --cookie            Optional (but recommanded): Provide the path to a text file that contains your cookie.
  -f, --from              Optional: Starting chapter when downloading a serie, default to 0.
  -h, --help              Output usage information
  -i, --info              Optional: Generate ComicInfo.xml.
  -m, --max-title-length  Optional: restrict the length of title as the folder name.
  -n, --name              Optional: Proride the serie title and override the folder name.
  -o, --output            Optional: The path where downloaded files are saved (default to .), setting this flag when using list will save a ComicInfo.xml to the path.
  -r, --retry             Optional: Automatically re-download chapters with failed images.
  -s, --slience           Optional: Silence the console output.
  -T, --timeout           Optional: Override the default 10s request timeout.
  -t, --to                Optional: Ending chapter when downloading a serie, defaults to chapter.length - 1.
  -u, --url               The url to the serie or the chapter.
  -v, --verbose           Optional: Display detailed error message, overrides silence.
  -V, --version           Output the version number
  -y, --yes               Optional: Skipping confirmation prompt when downloading series.
  -z, --zip-level         Optional: zip level for archive, default to 5.

Examples:
  - Download a serie from its 10th chapter to 20th chapter to the given destination, output zip archives with ComicInfo.xml by chapter, retry if a chapter is not properly downloaded.
  $ npx zerobyw-dl dl -c cookie.txt -f 10 -t 20 -o ~/Download/zerobyw -a zip -r -i -u serie_url

  - List all chapters of the given serie.
  $ npx zerobyw-dl ls -u serie_url

  - Download a chapter named Chapter1 to current path.
  $ npx zerobyw-dl ch -n Chapter1 -u chapter_url -c cookie.txt

:book: Library

Initializing downloader

import ZeroBywDownloader from "zerobyw-dl";

// Path for downloaded files
const destination = "~/Download/zerobyw";
// Configs
const configs = {
  // Get your cookie from the network inspector of your browser
  // Optional but highly recommanded, as ZeroByw partially blocks content for non-paid users
  cookie: "your_cookie",
  // Request timeout in ms (Optional: default to 10 seconds)
  timeout: 10000,
  // Silencing console output (Optional)
  silence: false,
  // numbers of images to be downloaded simultaneously (Optional: default to 10)
  batchSize: 10,
  // Display detailed error message, will override silence (Optional)
  verbose: false,
  // Output zip or cbz archives grouped by chapters (Optional)
  archive: "zip",
  // Additional headers for HTTP Requests (Using axios under the hood) (Optional)
  headers: {},
  // Restrict the length of title's length, in case your file system has such limitation (Optional: default to undefined)
  maxTitleLength: 30,
  // Zip level for archives (Optional: default to 5)
}; // Optional

const downloader = new ZeroBywDownloader(destination, configs);

:scroll: Getting serie info

const options = {
  output: "output_path", // Optional: Set this to write a ComicInfo.xml to the path, use true to output to the inherited destination folder
  // By default, the file is downloaded to destination/serie_title/ComicInfo.xml
  rename: "serie_title", // Optional: Override the serie title folder name
  filename: "ComicInfo.xml", // Optional: Overrides the default file name
};

const info = await downloader.getSerieInfo("serie_url");
// info
// {
//   title: "Serie Title",
//   chapters: [{
//     index: 0,
//     name: "Chapter Name",
//     uri: "chapter_uri", // without baseUrl
//   }],
//   info: {} // please refer to ComicInfo's Documentations
// }

:books: Downloading from a serie

const options = {
  start: 10, // Optional: Starting chapter, inclusive, default to 0
  end: 20, // Optional: Ending chapter, inclusive, default to the last (length - 1)
  confirm: false, // Optional: Launch a console prompt asking for user's confirmation before starting downloading, default to false
  rename: undefined, // Optional: Changing the folder name, default to undefined
  retry: false, // Optional: Automatically re-download chapters with failed images.
  info: true, // Optional: Generates ComicInfo.xml, default to **false**
  chapters: undefined, // Optional: Automatically re-download chapters with failed images
  onProgress: (progress) => {
    console.log(progress);
  }, // Optional: Called when a chapter is downloaded or failed to do so
}; // Optional

// progress
// {
//   index: 0, // chapter index
//   name: "Chapter Name",
//   uri: "chapter_uri",
//   status: "completed", // or "failed"
//   failed: 1, // numbers of images failed to be downloaded
//   // status is completed as the download queue is cleared, even with failed images.
// }

// Download all chapters from a serie
await downloader.downloadSerie("serie_url");

// Download from the 10th to the 20th chapter (11 chapters in total)
await downloader.downloadSerie("serie_url", options);

:bookmark: Downloading a chapter

const options = {
  index: 0, // chapter index
  title: "Serie Title",
  info: ComicInfo, // Optional: Generates ComicInfo.xml, please refer to ComicInfo's Documentations
  onProgress: (progress) => {}, // Optional: Called when a chapter is downloaded or failed to do so, the same as in serie options
}; // Optional

await downloader.downloadChapter(
  "Chapter Name",
  "chapter_url_with_base",
  options
);

:pencil2: Modify configs

// change one config
downloader.setConfig("archive", "cbz");
// merge configs
downloader.setConfigs({ archive: "cbz" }); // Will merge

:information_source: Information