mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Warn when server returns a zero-length document
This commit is contained in:
parent
dbc4bc0e5b
commit
eacebcd6dd
@ -259,6 +259,9 @@ class RecursiveFetcher(object):
|
||||
try:
|
||||
self.current_dir = linkdiskpath
|
||||
f = self.fetch_url(iurl)
|
||||
dsrc = f.read()
|
||||
if len(dsrc) == 0:
|
||||
raise Exception('No content')
|
||||
soup = self.get_soup(f.read())
|
||||
self.logger.debug('Processing images...')
|
||||
self.process_images(soup, f.geturl())
|
||||
@ -272,7 +275,7 @@ class RecursiveFetcher(object):
|
||||
self.process_links(soup, iurl, recursion_level+1)
|
||||
else:
|
||||
self.process_return_links(soup, iurl)
|
||||
self.logger.debug('Recursion limit reached. Skipping %s', iurl)
|
||||
self.logger.debug('Recursion limit reached. Skipping links in %s', iurl)
|
||||
|
||||
save_soup(soup, res)
|
||||
self.localize_link(tag, 'href', res)
|
||||
|
Loading…
x
Reference in New Issue
Block a user