View Single Post
Old 06-17-2025, 06:37 AM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You could do this using a Python code action in action chains. It seems that the steps would be:
  • Send the epub formats to disk. Use a known directory as the destination.
  • Invoke the python action to change the epubs to kepub.epubs in the known directory by scanning the directory for epubs that aren't kepub.epub.
The python action would scan the directory (tree) for .epub without being .kepub.epub. For each file found, convert it by calling
Code:
calibre.ebooks.oeb.polish.kepubify.make_options()
setting the options as you wish, then
Code:
calibre.ebooks.oeb.polish.kepubify.kepubify_path()
setting "outfile" to the basename of the epub + ".kepub.epub". Finally, delete the source epub.

I haven't tried writing and running the code but it seems straight-forward.

EDIT: Of course, you could do the same thing using a python script, which might be a better solution because the script can take arguments more easily than the action.

Last edited by chaley; 06-17-2025 at 08:57 AM.
chaley is offline   Reply With Quote