wget replaced by curl

This commit is contained in:
Luke Smith 2018-12-03 00:59:35 -05:00
parent 0640716f80
commit 3bb17b40a2
2 changed files with 10 additions and 7 deletions

View file

@ -2,12 +2,13 @@
# Feed this script a link and it will give dmenu
# some choice programs to use to open it.
x=$(printf "mpv\\nmpv (loop)\\nwget\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")
case "$x" in
case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in
"copy url") echo "$1" | xclip -selection clipboard ;;
mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
"mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;;
wget) wget "$1" >/dev/null 2>&1 ;;
browser) setsid "$TRUEBROWSER" "$1" & ;;
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
"queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;;
browser) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;;
feh) setsid feh "$1" >/dev/null 2>&1 & ;;
w3m) w3m "$1" >/dev/null 2>&1 ;;
"mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;;

View file

@ -13,13 +13,15 @@ scihub="http://sci-hub.tw/"
[ -z "$1" ] && { "$TRUEBROWSER"; exit; }
case "$1" in
*mkv|*webm|*mp4|*gif|*youtube.com*|*hooktube.com*)
*mkv|*webm|*mp4|*gif|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*)
setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
*png|*jpg|*jpe|*jpeg)
setsid feh "$1" >/dev/null 2>&1 & ;;
*mp3|*flac|*opus|*mp3?source)
setsid tsp wget "$1" >/dev/null 2>&1 & ;;
setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;;
*springer.com*)
setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;;
*) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;;
*)
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1"
else setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & fi ;;
esac