mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion: Ignore incorrectly URL encoded links instead of erroring out on them. Fixes #1421996 [Private bug](https://bugs.launchpad.net/calibre/+bug/1421996)
This commit is contained in:
parent
0f0e62b3a0
commit
8ae0a180c1
@ -222,9 +222,13 @@ class DetectStructure(object):
|
|||||||
if (not self.opts.duplicate_links_in_toc and
|
if (not self.opts.duplicate_links_in_toc and
|
||||||
self.oeb.toc.has_text(text)):
|
self.oeb.toc.has_text(text)):
|
||||||
continue
|
continue
|
||||||
num += 1
|
try:
|
||||||
self.oeb.toc.add(text, href,
|
self.oeb.toc.add(text, href,
|
||||||
play_order=self.oeb.toc.next_play_order())
|
play_order=self.oeb.toc.next_play_order())
|
||||||
|
num += 1
|
||||||
|
except ValueError:
|
||||||
|
self.oeb.log.exception('Failed to process link: %r' % href)
|
||||||
|
continue # Most likely an incorrectly URL encoded link
|
||||||
if self.opts.max_toc_links > 0 and \
|
if self.opts.max_toc_links > 0 and \
|
||||||
num >= self.opts.max_toc_links:
|
num >= self.opts.max_toc_links:
|
||||||
self.log('Maximum TOC links reached, stopping.')
|
self.log('Maximum TOC links reached, stopping.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user