From bcdd5eb4a2fdca223e247a612d6f5750da42b4aa Mon Sep 17 00:00:00 2001 From: Stephen Gregoratto Date: Fri, 10 Aug 2018 20:47:01 +1000 Subject: [PATCH] Change sci-hub command to use 1 perl-style grep --- .scripts/linkhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/linkhandler b/.scripts/linkhandler index 94fdd83..f540dc0 100755 --- a/.scripts/linkhandler +++ b/.scripts/linkhandler @@ -31,7 +31,7 @@ elif echo $wgetFiles | grep -w $ext > /dev/null; then elif echo "$@" | grep "$vidsites">/dev/null; then setsid nohup mpv -quiet "$1" > /dev/null & disown elif echo "$@" | grep "$academic">/dev/null; then - curl -sO $(curl -s "$scihub""$@" | grep location.href | grep -o http.*pdf) & disown + curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" & disown else setsid nohup $BROWSER "$1" 2>/dev/null & disown fi