Add SciHub link support

This commit is contained in:
m3tax 2018-10-16 17:49:05 +03:00
parent 6c54ccf774
commit cb1c74be06

View File

@ -28,6 +28,9 @@ imgurClientId=""
# Temp file directory
tmpDir="/tmp/linkhandler"
# SciHub domain
sciHub="http://sci-hub.tw"
## Handlers
# Images
@ -285,6 +288,12 @@ for arg; do
printMessage "Link type: Gif"
gifQueue+=( "${arg%/DASHPlaylist.mpd}/DASHPlaylist.mpd" )
# SciHub document
elif [[ $arg =~ springer\.com/.+ ]]; then
printMessage "Link type: Download"
curl -sO "$(curl -s "$sciHub/$arg" |
grep -Po "(?<=location.href=').+.pdf")" &disown
# Gif
elif echo "$arg" | grep -q "$gifSites" ||
echo "$gifFiles" | grep -q "${ext%%\?*}"; then