From dff0928af4b1c9d44b7a1e88380fa9579bbea929 Mon Sep 17 00:00:00 2001 From: psychhim Date: Sat, 25 Oct 2025 04:15:48 +0530 Subject: [PATCH] Fix: Special character encoding of URLs in .uploaded_files.sh --- upload.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/upload.sh b/upload.sh index 04777b1..7120fa0 100755 --- a/upload.sh +++ b/upload.sh @@ -47,10 +47,18 @@ set_colors() { } # HISTORY +url_encode() { + local url="$1" + # Encode special characters in URL, except safe ones + python3 -c "import urllib.parse; print(urllib.parse.quote('''$url''', safe=':/?&=#'))" +} + check_url_alive() { local url="$1" + local encoded + encoded=$(url_encode "$url") local status - status=$(curl -s -o /dev/null -w "%{http_code}" -L "$url") + status=$(curl -s -o /dev/null -w "%{http_code}" -L "$encoded") [[ "$status" == "200" ]] }