diff --git a/src/calibre/ebooks/metadata/library_thing.py b/src/calibre/ebooks/metadata/library_thing.py index 97a8834300..234d077765 100644 --- a/src/calibre/ebooks/metadata/library_thing.py +++ b/src/calibre/ebooks/metadata/library_thing.py @@ -14,11 +14,11 @@ from calibre.ebooks.BeautifulSoup import BeautifulSoup OPENLIBRARY = 'http://covers.openlibrary.org/b/isbn/%s-L.jpg?default=false' -def check_for_cover(isbn): +def check_for_cover(isbn, timeout=5.): br = browser() br.set_handle_redirect(False) try: - br.open_novisit(OPENLIBRARY%isbn) + br.open_novisit(OPENLIBRARY%isbn, timeout=timeout) except Exception, e: if callable(getattr(e, 'getcode', None)) and e.getcode() == 302: return True