From 622a4eb44b6b078d55a64c62b5596813d58dbd97 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 30 Jan 2024 19:46:49 -0600 Subject: [PATCH] Change default flaresolverr_proxy_timeout:59000 so it happens before default connect_timeout:60.0 --- calibre-plugin/plugin-defaults.ini | 13 ++++++++----- fanficfare/defaults.ini | 13 ++++++++----- fanficfare/fetchers/fetcher_flaresolverr_proxy.py | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/calibre-plugin/plugin-defaults.ini b/calibre-plugin/plugin-defaults.ini index 70d54906..5c13ae49 100644 --- a/calibre-plugin/plugin-defaults.ini +++ b/calibre-plugin/plugin-defaults.ini @@ -202,9 +202,10 @@ extratags: FanFiction ## between 0.5 and 1.5 times slow_down_sleep_time. #slow_down_sleep_time:0.5 -## How long to wait for each HTTP connection to finish. Longer times -## are better for sites that are slow to respond. Shorter times -## prevent excessive wait when your network or the site is down. +## How long to wait for each HTTP connection to finish in seconds. +## Longer times are better for sites that are slow to respond. +## Shorter times prevent excessive wait when your network or the site +## is down. connect_timeout:60.0 ## Use regular expressions to find and replace (or remove) metadata. @@ -640,7 +641,9 @@ browser_cache_age_limit:4.0 ## If you want to directly download images while using FlareSolverr ## for stories/chapters, you can set: ## use_flaresolverr_proxy:directimages -## flaresolverr_proxy_timeout is in integer milliseconds +## flaresolverr_proxy_timeout is in integer milliseconds. +## Keep flaresolverr_proxy_timeout set smaller than connect_timeout +## otherwise the connection *to* flaresolverr will timeout first. #[www.fanfiction.net] #use_flaresolverr_proxy:true @@ -648,7 +651,7 @@ browser_cache_age_limit:4.0 #flaresolverr_proxy_address:localhost #flaresolverr_proxy_port:8191 #flaresolverr_proxy_protocol:http -#flaresolverr_proxy_timeout:60000 +#flaresolverr_proxy_timeout:59000 ## Because some adapters can pull chapter URLs from human posts, the ## odds of errors in the chapter URLs can be higher for some diff --git a/fanficfare/defaults.ini b/fanficfare/defaults.ini index 7bd255cf..5b7a6bfa 100644 --- a/fanficfare/defaults.ini +++ b/fanficfare/defaults.ini @@ -222,9 +222,10 @@ extratags: FanFiction ## between 0.5 and 1.5 times slow_down_sleep_time. #slow_down_sleep_time:0.5 -## How long to wait for each HTTP connection to finish. Longer times -## are better for sites that are slow to respond. Shorter times -## prevent excessive wait when your network or the site is down. +## How long to wait for each HTTP connection to finish in seconds. +## Longer times are better for sites that are slow to respond. +## Shorter times prevent excessive wait when your network or the site +## is down. connect_timeout:60.0 ## For use only with CLI version--run a command on the generated file @@ -600,7 +601,9 @@ browser_cache_age_limit:4.0 ## If you want to directly download images while using FlareSolverr ## for stories/chapters, you can set: ## use_flaresolverr_proxy:directimages -## flaresolverr_proxy_timeout is in integer milliseconds +## flaresolverr_proxy_timeout is in integer milliseconds. +## Keep flaresolverr_proxy_timeout set smaller than connect_timeout +## otherwise the connection *to* flaresolverr will timeout first. #[www.fanfiction.net] #use_flaresolverr_proxy:true @@ -608,7 +611,7 @@ browser_cache_age_limit:4.0 #flaresolverr_proxy_address:localhost #flaresolverr_proxy_port:8191 #flaresolverr_proxy_protocol:http -#flaresolverr_proxy_timeout:60000 +#flaresolverr_proxy_timeout:59000 ## Because some adapters can pull chapter URLs from human posts, the ## odds of errors in the chapter URLs can be higher for some diff --git a/fanficfare/fetchers/fetcher_flaresolverr_proxy.py b/fanficfare/fetchers/fetcher_flaresolverr_proxy.py index 5280feb2..e4f10b7b 100644 --- a/fanficfare/fetchers/fetcher_flaresolverr_proxy.py +++ b/fanficfare/fetchers/fetcher_flaresolverr_proxy.py @@ -72,7 +72,7 @@ class FlareSolverr_ProxyFetcher(RequestsFetcher): fs_data = {'cmd': cmd, 'url':url, #'userAgent': 'Mozilla/5.0', - 'maxTimeout': int(self.getConfig("flaresolverr_proxy_timeout","60000")), + 'maxTimeout': int(self.getConfig("flaresolverr_proxy_timeout","59000")), # download:True causes response to be base64 encoded # which makes images work. 'cookies':cookiejar_to_jsonable(filter_cookies(self.get_cookiejar(),url)),