]>
zdv2.bktei.com Git - BK-2020-03.git/blob - user/htmlz_to_cbz.sh
2 # Desc: Collects .jpg/jpeg files from a Calibre .htmlz file into .cbz files
5 for fin
in .
/*.htmlz
; do
8 unzip "$fin" -x / -d "$dout";
10 mapfile
-t images
< <(cat index.html |
grep -E "(.jpg|.jpeg)" |
sed -E -e 's#.+(images/[0-9]+.(jpeg|jpg)).+#\1#' |
uniq; );
12 if [[ -d "$dout" ]]; then
17 for path
in "${images[@]}"; do
18 fnew
="${dout}/$(printf "%06d
" "$n").jpg";
22 if [[ -f cover.jpg
]]; then
23 cp -n cover.jpg .
/output
/000000.jpg
;
26 if [[ -f "$faout" ]]; then
29 zip -r output.cbz output
;
32 wait && echo "STATUS:Finished." 1>&2;