Skip to content

2.1.0

Compare
Choose a tag to compare
@yinyanfr yinyanfr released this 02 Apr 12:53
· 11 commits to main since this release
c591dd3

Release Note: 2.1.0

2023-04-02

Site Support

Ganma is a non-pirate site where contents are behind the paywall, you need a subscription purchased via Google Play Store and App Store and link it to your Ganma account, then log in to the website, open the Network inspector (F12 for mainstream browsers) and get your cookie from the request header.

Ganma provides official Japanese manga series.

Feature

  • [Library] Added getter and setter for baseUrl
  • New -A, --auth that accepts a string that contains token or cookie, having a lower priority than cookie.
  • [CLI] New -p, --presets flags, loading a JSON file that contains a set of parameters for sites.
    • Each site can have its own presets, use "module" to declare site, if "module" is not set, it's used for all sites.
    • Rules written below overrides those above.
    • Rule names are the same as CLI flags, full names using camelCase, e.g. maxTitleLength, zipLevel
    • You can still use flags, and flags come with higher priorities.
[
  {
    "archive": "cbz",
    "batch": 5,
    "retry": true,
    "info": true,
    "output": "~/Downloads/manga",
    "zipLevel": 5
  },
  {
    "module": "zerobyw",
    "batch": 10,
    "cookie": "./cookie.txt",
    "maxTitleLength": 30
  },
  {
    "module": "copymanga",
    "format": "webp"
  },
  {
    "module": "ganma",
    "auth": "your_cookie_string"
  }
]
npx comic-dl -p presets.json -u serie_url
  • [CLI] New generate, g, gen command for generating a new module.
# Using in the project root
# Using -m, --module flag for module name, starting with lowercase, camelCase
npx . gen --module ganma
  • [CLI] You can also generate a presets.json using the generate command
npx comic-dl gen --presets > presets.json

Fix

  • Fixed multiple bugs when downloading as images
    • Incorrect chapter names
    • Wrongly determination of existing chapters

Docs

  • Added docs of
    • [User] Site introductions
    • [User] Using presets
    • [Dev] Creating a new module

Dev

  • Added options to Chapter type, which is the returning value of getSerieInfo and gets passed to getImageList
  • getImageList now accepts a 2nd parameter options which is passed from the returning value of getSerieInfo
  • Added static preferredCLIPresets function to ComicDownloader that returns the CLIOptions to be written when gen --presets
class MySiteDownloader extends ComicDownloader {
  // ...

  getSerieInfo(url: string) {
    // ...
    return {
      // ...
      chapters: [
        {
          index: 0,
          name: 'chapter_name',
          uri: 'uri',
          options: {
            key: 'value', // put anything here
          },
        },
      ],
    };
  }

  getImageList(
    url: string,
    options?: Record<string, any>, // this options is that options above
  ) {
    // ...
  }
}

Misc

  • [CLI] CLI source codes are moved to src/cli, where cli.ts is renamed to index.ts
  • Added eslint and prettier