From 65c15b97bcbe3bf8edff2bb07c1292264ac57e43 Mon Sep 17 00:00:00 2001 From: vitaly Date: Sun, 31 May 2026 15:12:01 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D1=8F=D1=82=D1=8C=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=20=D0=B4=D0=B0=D0=B6=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=B8=D1=81=D1=87=D0=B5=D1=80=D0=BF=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=B2=D0=BE=D1=82=D1=8B=20(ret=3D429)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit При вводе нового ключа ret=429 теперь обрабатывается так же, как для сохранённого ключа: ключ сохраняется, затем предлагается продолжить всё равно. Co-Authored-By: Claude Sonnet 4.6 --- claude_setup.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/claude_setup.sh b/claude_setup.sh index 2f90aac..2816336 100755 --- a/claude_setup.sh +++ b/claude_setup.sh @@ -477,11 +477,15 @@ if [ -z "$api_key" ]; then _claude_test_api "https://api.deepseek.com/anthropic/v1/messages" "x-api-key: $api_key" "deepseek-v4-flash" _handle_api_response "DeepSeek" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.deepseek.com/top_up" ret=$? - if [ $ret -eq 0 ]; then + if [ $ret -eq 0 ] || [ $ret -eq 429 ]; then mkdir -p "$(dirname "$key_file")" echo "$api_key" > "$key_file" chmod 600 "$key_file" echo "Ключ сохранён." + if [ $ret -eq 429 ]; then + echo -n "Продолжить всё равно? (запросы могут не проходить) [y/N] " + read -r _ans; case "${_ans:-N}" in [Yy]*) ;; *) exit 1 ;; esac + fi else echo "Ключ НЕ сохранён." exit 1 @@ -542,11 +546,15 @@ if [ -z "$api_key" ]; then _claude_test_api "https://api.moonshot.ai/anthropic/v1/messages" "x-api-key: $api_key" "kimi-k2.6" _handle_api_response "Kimi" "$_CLAUDE_TEST_CODE" "$_CLAUDE_TEST_BODY" "Пополните баланс: https://platform.moonshot.ai/console/billing" ret=$? - if [ $ret -eq 0 ]; then + if [ $ret -eq 0 ] || [ $ret -eq 429 ]; then mkdir -p "$(dirname "$key_file")" echo "$api_key" > "$key_file" chmod 600 "$key_file" echo "Ключ сохранён." + if [ $ret -eq 429 ]; then + echo -n "Продолжить всё равно? (запросы могут не проходить) [y/N] " + read -r _ans; case "${_ans:-N}" in [Yy]*) ;; *) exit 1 ;; esac + fi else echo "Ключ НЕ сохранён." exit 1