From 6767d06511463f79dceffdc810406452d50d5c8d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 1 Aug 2024 19:10:30 +0300 Subject: [PATCH] Fix(bkmk_robot_base): Fix reporting proxy error --- Robots/bkmk_robot_base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5