To tag a folder of cbz files, place them in a folder with ComicInfo.yaml
If you want to try to scrape metadata from a Fandom wiki, make sure the url for each chapter's page follows this naming scheme:
- example.fandom.com/wiki/Chapter_1
- example.fandom.com/wiki/Chapter_2
- ...
- example.fandom.com/wiki/Chapter_10
If the url doesn't follow this pattern, don't use --fetch
- Keys left blank or deleted will result in no to change to
ComicInfo.xml
- Keys are split into three sections as follows:
- Every key in this section takes a string as a value.
- Setting the value of a key to
''
or""
will remove that key fromComicInfo.xml
- Setting the value of a key to anything other than a blank string will write that key to
ComicInfo.xml
autotag
andautotitle
take a bool (true
,on
,yes
)autotag
will try to parse the volume and chapter from the filenameautotitle
will try to parse the chapter title from the filename by assuming whatever is after the first " - " is the title. If the title has more than one " - ", title parsing will be skipped
- Fetching will only be done if
url
is not blank and the--fetch
CLI arg is passed url
should be set toexample.fandom.com/wiki/Chapter_
. The chapter number will be parsed from the filename and appended to the end of the urlExclude
takes either a string of comma-separated values or a yaml list. See the includedComicInfo.yaml
file for an example of both- Every other key takes a bool (
true
,on
,yes
)
Due to the inconsistencies between various Fandom wikis, you may need to modify fandom_fetcher.py
to fetch the correct data. If your change doesn't considerably break existing functionality, feel free to open a PR
Also, make sure to double-check the fetched data. If, for example, chapter 30 was initially released, then re-ordered to be chapter 31 in its volume release, the wiki may use either 30 or 31 for the url, potentially causing the wrong data to be fetched
jpeg2png
should be set to the path of the jpeg2png executable. It can be downloaded from here (a fork with some fixes - recommended) or here (the original)runafter
should be set to the absolute path of a script you want to run after BatchComicTagger has finished
path
sets the files will be saved to. Can be relative or absolute. If left blank, it will default tocurrent_directory/output
overwrite
allows new files to overwrite old ones. Takes a bool and defaults tofalse
removeoriginals
removes the original file after creating the new one. Takes a bool and defaults tofalse
- Clone the repository
git clone https://github.com/TheIceCreamTroll/BatchComicTagger.git
- Enter the project's directory
cd BatchComicTagger
- Install the Python requirements
pip install -r requirements.txt
dir
sets the current working directory. Use this ifBatchComicTagger.py
is in a different folder from the files you are tagging. Defaults to the current working directory ofBatchComicTagger.py
fetch
enables metadata fetching from a Fandom wiki. Defaults tofalse
- Place and edit a
ComicInfo.yaml
file into the folder with the .cbz files you wish to tag - Run
BatchComicTagger.py
- Processed files will be placed in (by default)
current_directory/output
I recommend keeping BatchComicTagger.py
in the folder you cloned it to and calling it from a .bat
/ .sh
script alongside ComicInfo.yaml
. Here are some examples:
- Windows:
python "PATH_TO_BatchComicTagger.py" --dir "%CD%" --fetch
- Linux / MacOS:
python "PATH_TO_BatchComicTagger.py" --dir "$(pwd)" --fetch
(haven't tested, but it probably works)