Dotfiles/bin/.bin/download
Jonathan Hodgson 90fc6ab4fb Many changes
2019-10-10 17:29:09 +01:00

27 lines
515 B
Bash
Executable file

#!/usr/bin/env bash
if [[ "$1" = "surf-download" ]]; then
echo "Doing surf"
shift
# I am shifting so that the vaiable numbers here are the same as in surf
useragent="$1"
cookiefile="$2"
referer="$3"
url="$4"
fi
path="~/Downloads/"
project=$(project current --path)
if [ -n "$project" ]; then
path="$project/Downloads/"
fi
mkcd -p "$path"
cd "$path"
echo "$useragent"
echo "$cookiefile"
echo "$referer"
echo "$url"
curl -g -L -J -O -A "$useragent" -b "$cookiefile" -c "$cookiefile" -e "$referer" "$url"