diff --git a/image-download b/image-download new file mode 100755 index 0000000..7a60a85 --- /dev/null +++ b/image-download @@ -0,0 +1,9 @@ +#!/bin/sh +# Script for downloading images without extension in qutebrowser (For example, images from Misskey) +# You should bind "hint links spawn --userscript image-download {hint-url}" (to ',d' for example) +# Downloaded images located at Downloads directory + +cd ~/Downloads +EXT=$(wget $1 2>&1 | grep "image" | grep -oP '\[\K[^\]]+' | grep -oP '.*image/\K.*') +FILE=$(echo "$1" | grep -oP '.*/\K.*') +mv "$FILE" "$FILE.$EXT"