diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-06-22 01:28:58 +0500 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-06-22 01:28:58 +0500 |
| commit | ac2576b5af83f68f1d5f83a6b8d38ef463185c59 (patch) | |
| tree | afe6a0a026bc736cca874912c287465916b7a339 /auth | |
| parent | 3fd621be134f71a4638b0aea2070116e9c5caf1e (diff) | |
bot: Workaround TLS/SSL timeout error
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
Diffstat (limited to 'auth')
| -rw-r--r-- | auth/donmai.zsh | 6 | ||||
| -rw-r--r-- | auth/idolcomplex.zsh | 18 | ||||
| -rw-r--r-- | auth/moebooru.zsh | 6 | ||||
| -rw-r--r-- | auth/sankakuchannel.zsh | 6 |
4 files changed, 30 insertions, 6 deletions
diff --git a/auth/donmai.zsh b/auth/donmai.zsh index 8bc04a8..5be8255 100644 --- a/auth/donmai.zsh +++ b/auth/donmai.zsh @@ -5,10 +5,14 @@ ib_auth_file="${cache}/${update_id}_profile.json" dump+=(${ib_auth_file##*/}) -if ! curl --max-time ${external_timeout} \ +if ! curl --connect-timeout ${connrefused_timeout} \ + --max-time ${external_timeout} \ --output "${ib_auth_file}" \ --proxy "${external_proxy}" \ --request GET \ + --retry 1 \ + --retry-connrefused \ + --retry-max-time $((external_timeout - connrefused_timeout)) \ --silent \ --user "${ib_login}:${ib_key}" \ --user-agent "${useragent}" \ diff --git a/auth/idolcomplex.zsh b/auth/idolcomplex.zsh index 3112514..c9a5986 100644 --- a/auth/idolcomplex.zsh +++ b/auth/idolcomplex.zsh @@ -6,11 +6,15 @@ ib_cookies="${cookies_file}" ib_auth_file="${cache}/${update_id}_login.html" dump+=(${ib_auth_file##*/}) -if ! curl --cookie-jar "${ib_cookies}" \ +if ! curl --connect-timeout ${connrefused_timeout} \ + --cookie-jar "${ib_cookies}" \ --max-time ${external_timeout} \ --output "${ib_auth_file}" \ --proxy "${external_proxy}" \ --request GET \ + --retry 1 \ + --retry-connrefused \ + --retry-max-time $((external_timeout - connrefused_timeout)) \ --silent \ --user-agent "${useragent}" \ "${ib_auth}/users/login" @@ -41,7 +45,8 @@ fi ib_auth_file="${cache}/${update_id}_authenticate.html" dump+=(${ib_auth_file##*/}) -if ! curl --cookie "${ib_cookies}" \ +if ! curl --connect-timeout ${connrefused_timeout} \ + --cookie "${ib_cookies}" \ --cookie-jar "${ib_cookies}" \ --data-urlencode "authenticity_token=${ib_token}" \ --data-urlencode "user[name]=${ib_login}" \ @@ -52,6 +57,9 @@ if ! curl --cookie "${ib_cookies}" \ --output "${ib_auth_file}" \ --proxy "${external_proxy}" \ --request POST \ + --retry 1 \ + --retry-connrefused \ + --retry-max-time $((external_timeout - connrefused_timeout)) \ --silent \ --user-agent "${useragent}" \ "${ib_auth}${ib_action}" @@ -79,11 +87,15 @@ fi ib_auth_file="${cache}/${update_id}_home.html" dump+=(${ib_auth_file##*/}) -if ! curl --cookie "${ib_cookies}" \ +if ! curl --connect-timeout ${connrefused_timeout} \ + --cookie "${ib_cookies}" \ --max-time ${external_timeout} \ --output "${ib_auth_file}" \ --proxy "${external_proxy}" \ --request GET \ + --retry 1 \ + --retry-connrefused \ + --retry-max-time $((external_timeout - connrefused_timeout)) \ --silent \ --user-agent "${useragent}" \ "${ib_auth}/users/home" diff --git a/auth/moebooru.zsh b/auth/moebooru.zsh index c3a893d..c67fddc 100644 --- a/auth/moebooru.zsh +++ b/auth/moebooru.zsh @@ -5,12 +5,16 @@ ib_auth_file="${cache}/${update_id}_user.json" dump+=(${ib_auth_file##*/}) -if ! curl --data-urlencode "username=${ib_login}" \ +if ! curl --connect-timeout ${connrefused_timeout} \ + --data-urlencode "username=${ib_login}" \ --data-urlencode "api_key=${ib_key}" \ --get \ --max-time ${external_timeout} \ --output "${ib_auth_file}" \ --proxy "${external_proxy}" \ + --retry 1 \ + --retry-connrefused \ + --retry-max-time $((external_timeout - connrefused_timeout)) \ --silent \ --user-agent "${useragent}" \ "${ib_auth}/user.json" diff --git a/auth/sankakuchannel.zsh b/auth/sankakuchannel.zsh index 86f076a..8425cc7 100644 --- a/auth/sankakuchannel.zsh +++ b/auth/sankakuchannel.zsh @@ -10,12 +10,16 @@ ib_login_data="$(jq --null-input --compact-output \ ib_auth_file="${cache}/${update_id}_token.json" dump+=(${ib_auth_file##*/}) -if ! curl --data "${ib_login_data}" \ +if ! curl --connect-timeout ${connrefused_timeout} \ + --data "${ib_login_data}" \ --header "Content-Type: application/json" \ --max-time ${external_timeout} \ --output "${ib_auth_file}" \ --proxy "${external_proxy}" \ --request POST \ + --retry 1 \ + --retry-connrefused \ + --retry-max-time $((external_timeout - connrefused_timeout)) \ --silent \ --user-agent "${useragent}" \ "${ib_auth}/auth/token" |
