Repository navigation
Installation and Quick Start
Installing, scraping a first comic, the common flags, and priming comics for another machine to finish.
Python 3.9+ and Chrome or Firefox (Selenium 4.6+ fetches the driver itself), or use the Docker container.
pip install -r requirements.txtpython mirror_base.py --output "Uncompressed/MyComic" "https://example.com/comic/first-page/"It finds the image and the next link, walks forward until there is no next page, saves each image, and
writes mirror_metadata.json in the folder plus a .cbz: under a sibling CBZs/ tree when one exists
beside Uncompressed/, otherwise beside the folder (details in Library Layout). Run the same command
later and it resumes from where it stopped, adding only new pages. For a whole library, see
Running Unattended.
| Flag | Effect |
|---|---|
-o PATH, --cbz-path PATH, --no-cbz
|
Where pages go; where the .cbz goes; no archive at all. |
-p, --prefix; -i N
|
Number saved files (see below), counting from N (default 1). |
--prime; --keep-index / --no-keep-index
|
Below. |
-ej; -f; -w N
|
JavaScript on (off by default, for speed); Firefox instead of Chrome; wait N seconds per page. |
--no-headless; -v
|
Show the browser window; log every step. |
--check |
Report which element paths match a page, and stop. |
--no-direction-check, -m, -n; --no-multi-page
|
See Notes and Limits; Several pages on one address. |
A page keeps the name the site gives it: the filename the server sends, else the last part of the image
address without its query string. Only a name with no picture extension (/comic-image/1650564/?token=...)
gets one, from the server's content type or the file's first bytes. Comics scraped when .png was added to
every name keep those names; the page a run re-saves at its start switches to the new spelling rather than
being held twice.
Use --prefix when the filename scheme changes mid-run (a date stamp becomes NAME_0421.jpg), since a
prefix pins download order, which is publication order; and when a site numbers each chapter from one
(/comics/1/1.png, /comics/131/1.png), where chapters would overwrite each other: a scrape stops with
code 9 first. Such a site reuses a name at each chapter boundary, so the backwards check waits for a second
backwards step.
A scrape from page one into an empty folder records which page is which, with real names and sizes, so the
comic never needs a walk. To start a comic over, delete its folder and archive
and add it again; its old index is renamed aside in config/index with .replaced-<date>.
Scraping over a network share is slow. --prime saves only the first page, follows the next link once to
prove it works, writes metadata and archive, and stops:
python mirror_base.py --prime -o "D:/Comics/Uncompressed/MyComic" "https://example.com/comic/first-page/"The metadata resumes on page two, so the next update_comics.py run on the machine holding the library
fetches the rest (drop an update-now.txt to start
it). No next button means the comic has one page or needs its next element added (Element Paths).
ZornCoMix is licensed under the PolyForm Noncommercial License 1.0.0. Based on a script by AChillVamp; see NOTICE.
Getting started
Running it
Reading
Archives and chapters
Reference