From a9360e6bc3c5df03f938c8efbde5025ff34c1dad Mon Sep 17 00:00:00 2001 From: Bradley Newman Date: Wed, 2 Oct 2024 21:43:23 +0930 Subject: [PATCH] Add --nokepub option By setting this to true, '.epub' format will be output rather than '.kepub.epub' --- kindlecomicconverter/comic2ebook.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index ea61d7e..717ce7a 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -685,7 +685,11 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber): if srcpath[-1] == os.path.sep: srcpath = srcpath[:-1] if 'Ko' in options.profile and options.format == 'EPUB': - ext = '.kepub.epub' + if options.noKepub: + # Just use normal epub extension if no_kepub option is true + ext = '.epub' + else: + ext = '.kepub.epub' if wantedname is not None: if wantedname.endswith(ext): filename = os.path.abspath(wantedname) @@ -999,6 +1003,8 @@ def makeParser(): output_options.add_argument("-f", "--format", action="store", dest="format", default="Auto", help="Output format (Available options: Auto, MOBI, EPUB, CBZ, KFX, MOBI+EPUB) " "[Default=Auto]") + output_options.add_argument("--nokepub", action="store_true", dest="noKepub", default=False, + help="If format is EPUB, output file with '.epub' extension rather than '.kepub.epub'") output_options.add_argument("-b", "--batchsplit", type=int, dest="batchsplit", default="0", help="Split output into multiple files. 0: Don't split 1: Automatic mode " "2: Consider every subdirectory as separate volume [Default=0]")