From: Oleg Broytman Date: Thu, 1 Aug 2024 16:10:30 +0000 (+0300) Subject: Fix(bkmk_robot_base): Fix reporting proxy error X-Git-Tag: 5.4.0~2 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=6767d06511463f79dceffdc810406452d50d5c8d;p=bookmarks_db.git Fix(bkmk_robot_base): Fix reporting proxy error --- diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 9b989e5..26a0fec 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -337,7 +337,9 @@ class robot_base(Robot): if url_host in self.proxy_error: return 'see prev. error', None, None, None, None + use_proxy = False if url_host in self.proxy_ok: + use_proxy = True self.log(' Immediately trying with the proxy') error, http_status_code, redirect_to, headers, content = \ self.get(bookmark, url, @@ -353,6 +355,7 @@ class robot_base(Robot): ): self.log(' Error : %s' % error) if self.proxy and http_status_code != 404: + use_proxy = True self.log(' Retrying with the proxy...') error, http_status_code, redirect_to, headers, content = \ self.get(bookmark, url, @@ -361,7 +364,7 @@ class robot_base(Robot): if error is None: self.proxy_ok.add(url_host) if error is not None: - if self.proxy and http_status_code != 404: + if use_proxy: self.log(' Proxy error : %s' % error) if url_host not in self.proxy_ok: self.proxy_error.add(url_host)