mirror of
https://github.com/DrewThomasson/ebook2audiobook.git
synced 2026-01-10 14:28:15 -05:00
...
This commit is contained in:
@@ -511,14 +511,7 @@ def convert2epub(id:str)-> bool:
|
||||
error = f'Unsupported file format: {file_ext}'
|
||||
print(error)
|
||||
return False
|
||||
if file_ext == '.txt':
|
||||
with open(file_input, 'r', encoding='utf-8') as f:
|
||||
text = f.read()
|
||||
text = text.replace('\r\n', '\n')
|
||||
text = text.replace('\n\n', '\n[pause]\n')
|
||||
with open(file_input, 'w', encoding='utf-8') as f:
|
||||
f.write(text)
|
||||
elif file_ext == '.pdf':
|
||||
if file_ext == '.pdf':
|
||||
msg = 'File input is a PDF. flatten it in XHTML...'
|
||||
print(msg)
|
||||
doc = fitz.open(file_input)
|
||||
|
||||
Reference in New Issue
Block a user