Skip to content

Instantly share code, notes, and snippets.

@grodzik
Created February 6, 2010 13:24
Show Gist options
  • Save grodzik/296714 to your computer and use it in GitHub Desktop.
Save grodzik/296714 to your computer and use it in GitHub Desktop.
#!/bin/sh
# just an example of how you could handle your downloads
# try some pattern matching on the uri to determine what we should do
# Some sites block the default wget --user-agent..
GET="wget --user-agent=Firefox --content-disposition --load-cookies=${HOME}/.local/share/uzbl/cookies.txt -nv "
dest="$HOME/Downloads/"
url="$8"
http_proxy="$9"
export http_proxy
test "x$url" = "x" && { echo "you must supply a url! ($url)"; exit 1; }
cd "$dest"
cmd=`${GET} "${url}" 2>&1| sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}[[:blank:]]\+[0-9:]\{8\}[[:blank:]]\+URL[^ ]\+ \[[0-9\/]\+\][[:blank:]]\+->[[:blank:]]\+"\([^"]\+\)".*$/\1/'`
notify-send "Pobrano" "${cmd}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment