fix: download apk

This commit is contained in:
Nezumi-2711
2026-03-16 18:00:53 +07:00
parent d24f8939d0
commit 34d34bc878
+8 -3
View File
@@ -215,7 +215,7 @@ _req() {
local ip="$1" op="$2"
shift 2
if [ "$op" = - ]; then
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 5 --retry 0 --fail -s -S "$@" "$ip"; then
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 10 --retry 3 --retry-delay 2 --fail -s -S "$@" "$ip"; then
epr "Request failed: $ip"
return 1
fi
@@ -227,14 +227,19 @@ _req() {
while [ -f "$dlp" ]; do sleep 1; done
return
fi
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 5 --retry 0 --fail -s -S "$@" "$ip" -o "$dlp"; then
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 10 --retry 3 --retry-delay 2 --fail -s -S "$@" "$ip" -o "$dlp"; then
epr "Request failed: $ip"
return 1
fi
mv -f "$dlp" "$op"
fi
}
req() { _req "$1" "$2" -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0"; }
req() {
_req "$1" "$2" \
-H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" \
-H "Accept-Language: en-US,en;q=0.5"
}
gh_req() { _req "$1" "$2" -H "$GH_HEADER"; }
gh_dl() {
if [ ! -f "$1" ]; then