Fixed bool is not iterable if URL is not fetchable
This commit is contained in:
parent
67611ab648
commit
0866367887
@ -59,12 +59,12 @@ def download(url):
|
|||||||
return dl, contenttype
|
return dl, contenttype
|
||||||
except ValueError:
|
except ValueError:
|
||||||
tools.warning("Invalid URL")
|
tools.warning("Invalid URL")
|
||||||
return False
|
return False, None
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
tools.warning("Unable to get "+url+" using proxy "+proxy+". It " +
|
tools.warning("Unable to get "+url+" using proxy "+proxy+". It " +
|
||||||
"may not be available.")
|
"may not be available.")
|
||||||
continue
|
continue
|
||||||
return False
|
return False, None
|
||||||
|
|
||||||
|
|
||||||
isbn_re = re.compile(r'isbn[\s]?:?[\s]?((?:[0-9]{3}[ -]?)?[0-9]{1,5}[ -]?[0-9]{1,7}[ -]?[0-9]{1,6}[- ]?[0-9])',
|
isbn_re = re.compile(r'isbn[\s]?:?[\s]?((?:[0-9]{3}[ -]?)?[0-9]{1,5}[ -]?[0-9]{1,7}[ -]?[0-9]{1,6}[- ]?[0-9])',
|
||||||
|
Loading…
Reference in New Issue
Block a user