enabled multi-level ToC

This commit is contained in:
SexbearLmao
2021-03-30 01:24:19 -05:00
parent 889463f6a7
commit f2c60afd88

View File

@@ -138,6 +138,7 @@ def main(cli_args):
parser.add_argument('-I', '--images', help='NOT IMPLEMENTED also attempt to download any images', action='store_true') parser.add_argument('-I', '--images', help='NOT IMPLEMENTED also attempt to download any images', action='store_true')
parser.add_argument('-C', '--auto-cover', help='NOT IMPLEMENTED generate an automatic cover', action='store_true', dest='cover') parser.add_argument('-C', '--auto-cover', help='NOT IMPLEMENTED generate an automatic cover', action='store_true', dest='cover')
parser.add_argument('-T', '--no-trim', help="don't try to trim footer at bottom of chapters", action='store_false', dest='trim') parser.add_argument('-T', '--no-trim', help="don't try to trim footer at bottom of chapters", action='store_false', dest='trim')
#TODO add arguments to control ToC
parser.add_argument('url', help='url to download', nargs='+') parser.add_argument('url', help='url to download', nargs='+')
#args = parser.parse_args(cli_args) #args = parser.parse_args(cli_args)
args = parser.parse_args() args = parser.parse_args()
@@ -166,12 +167,13 @@ def main(cli_args):
return 1 return 1
docs = [d.result() for d in documents] docs = [d.result() for d in documents]
docs = [d for d in docs if d] docs = [d for d in docs if d]
if cover or not cover.endswith('.epub'): if cover or not name.endswith('.epub'):
merge_name = rand_name() + 'epub' merge_name = rand_name() + '.epub'
else: else:
#no final conversion step
merge_name = name merge_name = name
merge_args = ['calibre-debug', '--run-plugin', 'EpubMerge', '--', merge_args = ['calibre-debug', '--run-plugin', 'EpubMerge', '--',
'-N', '-o', merge_name] '-o', merge_name]
if title: if title:
merge_args += ['-t', title] merge_args += ['-t', title]
if author: if author: