mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-30 21:41:57 -04:00
Fix bug in web2disk that caused download of some webpages that have empty hrefs to fail.
This commit is contained in:
parent
cc06c421c3
commit
4c30684322
@ -49,7 +49,7 @@ def save_soup(soup, target):
|
||||
for tag in soup.findAll(['img', 'link', 'a']):
|
||||
for key in ('src', 'href'):
|
||||
path = tag.get(key, None)
|
||||
if path and os.path.exists(path) and os.path.isabs(path):
|
||||
if path and os.path.isfile(path) and os.path.exists(path) and os.path.isabs(path):
|
||||
tag[key] = relpath(path, selfdir).replace(os.sep, '/')
|
||||
|
||||
f = codecs.open(target, 'w', 'utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user