Releases: yinyanfr/comic-dl
2.4.0
Realese Note: 2.4.0
2023-04-29
🎂 Happy birthday to me
Module
- Changed the base url for Zerobyw. (#12)
Feature
-
[CLI] Simplify input (#21)
# From 2.4.0, this is now valid npx comic-dl https://www.copymanga.site/comic/hulishaonvmuye
- Now if you don't input command, the CLI will execute the
download
command by default. - You can now directly add url without the
-u, --url
flag - You still need to wrap your urls in quotation marks if it contains special characters
- The
download
command now has a new aliasserie
.
- Now if you don't input command, the CLI will execute the
-
[CLI] comic-dl now reads presets and cookies from
~/.comic-dl
. (#13)-
You need to create this folder by yourself under your personal folder.
-
comic-dl reads presets from
~/.comic-dl/presets.json
. -
comic-dl reads cookies from
~/.comic-dl/cookies/[module_name].txt
. -
The
-p, --presets
flag and the-c, --cookie
flag have higher priorties. -
The tree structure of
.comic-dl
:.comic-dl ├─ cookies │ └─ zerobyw.txt └─ presets.json
-
-
[core]
options.retry
now can accept a number as its value, which indicates the number of retrys (default to 1 whentrue
). (#19) -
Experimental Added the
option.kavita
option and the-k, --kavita
flag for the compatibility of kavita. (#22)- When organizing manga series, Kavita ignores the folder structure and treat chapters with a name like
17-21
as a standalone serie. - So this option / flag will rename such chapter by one single number (i.e.
17-21
to17
). - This option / flag is experimental, it may add to or change its behaviors to future discovered Kavita compatibility issues.
- When organizing manga series, Kavita ignores the folder structure and treat chapters with a name like
Fix
- [core] Fixed the bug where special characters are not escaped in ComicInfo.xml. (#11)
- [core] Fixed the bug where
options.retry
is losingchapter.uri
. (#18) - [CLI] Fixed the bug that the CLI is not correctly reading paths with a
~
in presets. (#14)
Full List
- fix(core): xml escape by @yinyanfr in #11
- fix(module): Zerobyw - change url by @yinyanfr in #12
- feat(cli): .comic-dl by @yinyanfr in #13
- fix(cli): parse paths with a tilda by @yinyanfr in #15
- feat(core): retry numbers by @yinyanfr in #19
- ci: add linting to github actions by @yinyanfr in #20
- feat(cli): simplify input by @yinyanfr in #21
- feat(core): kavita compatibility - rename by @yinyanfr in #22
Full Changelog: 2.3.0...2.4.0
2.3.0
Release Note: 2.3.0
2023-04-18
Deprecation
- [Dev] Import ComicDownloader from 'comic-downloader.ts' is deprecated, and will be removed in the next major version.
- This is only for module developers, the usage of the library and the CLI is unaffected.
// Your module
// <= 2.2.0 and < 3.0.0
import ComicDownloader from '../../comic-downloader';
// >= 2.3.0
import ComicDownloader from '../../core';
Feature
- [CLI] New
-S, --shorthand-url
flag is added, please refer to the documentation of each module.- The
-m, --module
flag is required when using this flag. - When using the
-h, --history
flag, the url registered will still be the completed url. - A
static urlCompletion
method is added to modules for developers. - The
-u, --url
flag has a higher priorty than this flag.
- The
- [CLI] Experimental New
-l, --list
flag is added, that can download a list of urls.- This flag only applies to the
dl, download
command. - Please note that due to the stability of each module, you may end up with multiple failures.
- You can use the
-h, --history
flag added in theversion 2.2.0
to register your download history, so that you can use this flag as a "sync" functionality. - You can use the
-S, --shorthand-url
flag without value if the list your list is composed of shorthand urls.
- This flag only applies to the
Fix
- [core] Fixed a bug that causes index 0 to display improperly.
- [core] To prevent unnecessary network requests, the check for chapter existence has been moved ahead of the network requests.
Dev
- The
comic-downloader.ts
is moved tocore/index.ts
, causing the deprecation, butcomic-downloader.ts
will still exist for a while until the next major version. - A
static urlCompletion
method is added to modules in order to parse the shorthand urls.
2.2.0
Release Note: 2.2.0
2023-04-08
Site Support
- Fixed Ganma:
downloadChapter
not working as intended
Feature
- New
configs.indexedChapters
config and-I, --indexed-chapters
flag, that will add chapter index to the folder / archive file name. - [CLI] Experimental New
-h, --history
flag, that will add the serie url to a given text file when using thedownload
command, its value is default to ahistory.txt
file under the same path of--output
. - New
options.group
option and-g, --group
flag, for sites like Copymanga, that offers series in multiple groups, default todefault
.
Dev
- A second paramenter
options?: Partial<SerieDownloadOptions | CliOptions>
is added togetSerieInfo
that receive the options passed todownloadSerie
Misc
- [CLI] Added spinners using
ora
2.1.0
Release Note: 2.1.0
2023-04-02
Site Support
- Added Ganma
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 thancookie
. - [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.
- Each site can have its own presets, use
[
{
"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
toChapter
type, which is the returning value ofgetSerieInfo
and gets passed togetImageList
getImageList
now accepts a 2nd parameteroptions
which is passed from the returning value ofgetSerieInfo
- Added
static preferredCLIPresets
function toComicDownloader
that returns the CLIOptions to be written whengen --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
, wherecli.ts
is renamed toindex.ts
- Added eslint and prettier
2.0.0
Release Note: 2.0.0
2023-03-31
🎉 zerobyw-dl
now becomes comic-dl
.
Now this library is designed to be used with multiple manga / comic sites.
Site Support
- Added Copymanga
Changes
- [library] The code has been refactored and can now add sites as plugins.
// Before
import ZeroBywDownloader from "zerobyw-dl";
const downloader = new ZeroBywDownloader(destination, configs);
// Now
import { ZeroBywDownloader } from "comic-dl";
const downloader = new ZeroBywDownloader(destination, configs);
- [CLI] The
-b, --batch
flag is now default to 1 when not set. - Downloaded images are now renamed by index (01 ~ ).
- Downloaders now ignores downloaded chapters by default, set
options.override
totrue
or for CLI use-O, --override
if you want to override. - [Library] Writing ComicInfo.xml to file is removed from
getSerieInfo
, thus a seperate functionwriteComicInfo
has taken place, options fromgetSerieInfo
is moved towriteComicinfo
, and the typedef is renamedWriteInfoOptions
.
// Before
const serie = await downloader.getSerieInfo("url", { output: true });
// Now
const serie = await downloader.getSerieInfo("url");
await writeComicInfo(serie, { output: true });
- [CLI] New flag
-m, --module
is added to specify the module (site) to use, as a matter of which, the short-hand flag to--max-title-length
is changed to-M
. If--module
is not defined, comic-dl will attempt to detect the matching module by url.
# Before
npx zerobyw-dl dl -c cookie.txt -o ~/Download/zerobyw -a zip -r -i -u serie_url
# Now
npx comic-dl dl -m zerobyw -c cookie.txt -o ~/Download/zerobyw -a zip -r -i -u serie_url -b 10
# You can skip -m flag unless comic-dl fails to detect the site module
# Batch download is now default to 1, set it manually for download speed
- [CLI] the
-s, --silence
flag now skips the confirm prompt when downloading series.
Fix
- [CLI] Fixed an error that causes the downloader to download the entire serie when
-C, --chapters
is set to0
.
1.5.1
1.5.0
Release Note: 1.5.0
2023-03-18
Features
- You can now download or embbed a ComicInfo.xml in chapters
getSerieInfo
andlist
(CLI) now displays ComicInfo fields- [Library] added
info
(boolean) as an option for serie, you can also pass it to chapter download, but you need to provide the info object - [Library] Added options for list so that you can generate and write ComicInfo.xml
- [CLI] added
-i, --info
flag fordownload
to write ComicInfo.xml and forls
to display it, use-o
forlist
to write the ComicInfo.xml
Fix
- [CLI] Fixed a bug that would cause folder name to be wrongly set when downloading a single chapter
1.4.1
Release Note: 1.4.1
2023-03-17
Features
- New Serie Download Options
- rename: Override the serie title, for CLI: reusing -n, --name
- retry: Automatically redownload failed chapters, for CLI: -r, --retry
- chapters: Only downloading given list of chapter indexes, for CLI: -c, --chapters 1,2,4,7
- Better logs when partially downloading serie
- Improved type consistency
- Added uri to
DownloadProgress