Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Last active November 1, 2023 20:18
Show Gist options
  • Save iolloyd/2159181 to your computer and use it in GitHub Desktop.
Save iolloyd/2159181 to your computer and use it in GitHub Desktop.
Script to download from easynews
#!/bin/sh
USER=god
PASS=allyourbasearebelongtous
FILE=`echo "$1" | sed 's_\(https://\)\(.*\)\(secure\.\)\(.*\)\(/.*\)_\2\4\5_'`
FILE=`echo "$1" | sed 's_\(https://\)\(boost4-\)*\(.*\)\(secure\.\)\(.*\)\(/.*\)_\3\5\6_'`
CMD='curl -Y 12800 -y 5 -C - -O http://'$USER':'$PASS'@'$FILE
echo $CMD
go=true
while $go; do
$CMD
# curl: (28) Operation too slow. Less than 12800 bytes/sec transferred the last 5 seconds
# curl: (6) Couldn't resolve host
if [ $? != 28 -a $? != 6 ]; then
go=false
fi
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment