View Single Post
Old 03-21-2021, 10:19 AM   #1
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 819
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
explode-book and implode-book problems

This used to work but I am getting "TypeError: a bytes-like object is required not str" when I run the following .bat file in Windows 8:

for /r %%f in (*.epub) do (
calibre-debug --explode-book -x "%%f" "%%~pnf"
)

It is supposed to create a directory for each epub and unzip all the files so that I can make batch edits on the html or css files.

It still creates the directories and unzips the files, but when I try to use implode-book, it fails completely, with no files created in the target directory. The .bat file to rebuild the epubs is:

mkdir ".\_RebuiltEpubs\"
for /d %%d in (*) do (
if not ".\%%d"==".\_RebuiltEpubs" (
calibre-debug --implode-book -i ".\%%d" ".\_RebuiltEpubs\%%d.epub"
)
)

I feel like a dummy but I am having trouble figuring this out. Thanks for any help.

irene
icallaci is offline   Reply With Quote