2 Commits
v2.2 ... v2.2.2

Author SHA1 Message Date
eneller
b3cd49326f feat: prettier logging 2025-04-05 01:42:20 +02:00
eneller
401d02e0ca fix: parameter getdir 2025-04-02 11:26:24 +02:00
2 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
[project]
name = "epub2go"
version = "2.2"
version = "2.2.2"
description = "EPUB converter using wget, pandoc and python glue"
readme = "README.md"
requires-python = ">=3.12"

View File

@@ -46,7 +46,7 @@ class GBConvert():
cleanpages: bool = True,
):
tocpage = os.path.dirname(url) # ToC website url
dir_output = self.getDir()
dir_output = self.getDir(url)
logger.debug('Downloading to %s, expecting files in in %s', self.dir_download, dir_output)
author = author
title = title
@@ -106,7 +106,6 @@ class GBConvert():
#TODO --epub-cover-image
#TODO toc if it isnt described by <h> tags, e.g. https://www.projekt-gutenberg.org/adlersfe/maskenba/
filename = f'{title} - {author}.epub'
logger.debug('Creating epub as "%s"',filename)
command = f'''pandoc -f html -t epub \
-o "{filename}" \
--reference-location=section \
@@ -115,6 +114,7 @@ class GBConvert():
--metadata author="{author}" \
--epub-title-page=false \
{" ".join(chapters)} '''
logger.debug('Calling "%s"', command)
subprocess.run(shlex.split(command), cwd=dir_output, check=True)
return os.path.abspath(os.path.join(dir_output,filename))