repo: uritools
action: commit
revision: 
path_from: 
revision_from: fc8bbabe4c2c60f58fcc307a0f6e0fa81a8e3424:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit fc8bbabe4c2c60f58fcc307a0f6e0fa81a8e3424
Author: epoch 
Date:   Mon Feb 24 01:49:28 2025 +0000

    changed unshorten.sh to send a useragent

diff --git a/unshorten.sh b/unshorten.sh
index 180111f731223d014e02ac632a6c890ea26aea21..
index ..a0387d07fed439bb0fe1847b3bd9601301f04c35 100755
--- a/unshorten.sh
+++ b/unshorten.sh
@@ -5,9 +5,11 @@ scheme="$(printf '%s\n' "$uri" | uricut -s)"
 domain="$(printf '%s\n' "$uri" | uricut -d)"
 port="$(printf '%s\n' "$uri" | uricut -P)"

+UA="Mozilla/5.0 (impersonator)"
+
 case "$scheme" in
   http*)
-    curl -Isg "$1" | grep -i ^Location: | head -n1 | tr -s ' ' | tr -d '\r' | cut '-d ' -f2- | sed 's|^/|'"$scheme"'://'"$domain"'/|g'
+    curl -A "$UA" -Isg "$1" | grep -i ^Location: | head -n1 | tr -s ' ' | tr -d '\r' | cut '-d ' -f2- | sed 's|^/|'"$scheme"'://'"$domain"'/|g'
     ;;
   gemini)
     gemini-get "$1" | head -n1 | sed 's/^3[0-9] //g'

-----END OF PAGE-----