Ignore SSL errors when contacting isbndb as they seem to have no intention of fixing their broken SSL certificate

This commit is contained in:
Kovid Goyal 2017-07-07 08:51:09 +05:30
parent ade57f1447
commit 897e1eabfd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 2 deletions

View File

@ -23,6 +23,7 @@ def create_log(ostream=None):
log.outputs = [FileStream(ostream)]
return log
# Comparing Metadata objects for relevance {{{
words = ("the", "a", "an", "of", "and")
prefix_pat = re.compile(r'^(%s)\s+'%("|".join(words)))
@ -216,6 +217,10 @@ class Source(Plugin):
#: correctly first
supports_gzip_transfer_encoding = False
#: Set this to True to ignore HTTPS certificate errors when connecting
#: to this source.
ignore_ssl_errors = False
#: Cached cover URLs can sometimes be unreliable (i.e. the download could
#: fail or the returned image could be bogus. If that is often the case
#: with this source set to False
@ -293,7 +298,7 @@ class Source(Plugin):
@property
def browser(self):
if self._browser is None:
self._browser = browser(user_agent=self.user_agent)
self._browser = browser(user_agent=self.user_agent, verify_ssl_certificates=not self.ignore_ssl_errors)
if self.supports_gzip_transfer_encoding:
self._browser.set_handle_gzip(True)
return self._browser.clone_browser()
@ -596,4 +601,3 @@ class Source(Plugin):
pass
# }}}

View File

@ -29,6 +29,7 @@ class ISBNDB(Source):
supports_gzip_transfer_encoding = True
# Shortcut, since we have no cached cover URLS
cached_cover_url_is_reliable = False
ignore_ssl_errors = True
options = (
Option('isbndb_key', 'string', None, _('IsbnDB key:'),