mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Raise an appropriate error for DTBook EPUB files
This commit is contained in:
parent
c83e888bb9
commit
6363aaa5b9
@ -146,6 +146,10 @@ class EPUBInput(InputFormatPlugin):
|
|||||||
self.rationalize_cover(opf, log)
|
self.rationalize_cover(opf, log)
|
||||||
|
|
||||||
self.optimize_opf_parsing = opf
|
self.optimize_opf_parsing = opf
|
||||||
|
for x in opf.itermanifest():
|
||||||
|
if x.get('media-type', '') == 'application/x-dtbook+xml':
|
||||||
|
raise ValueError(
|
||||||
|
'EPUB files with DTBook markup are not supported')
|
||||||
|
|
||||||
with open('content.opf', 'wb') as nopf:
|
with open('content.opf', 'wb') as nopf:
|
||||||
nopf.write(opf.render())
|
nopf.write(opf.render())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user