diff options
-rwxr-xr-x | showURLimage.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/showURLimage.sh b/showURLimage.sh index 0650f0c..ee67593 100755 --- a/showURLimage.sh +++ b/showURLimage.sh @@ -3,11 +3,14 @@ # Downloads an url to /tmp and opens it with sxiv. # If the url is from youtube tries to download the thumbnail. +folder="/tmp/showURLimage" + url="$1" -echo "$url" | grep -i "youtube" >/dev/null && +if echo "$url" | grep -i "youtube" >/dev/null; then url="$(youtube-dl --get-thumbnail "$url")" + folder="${folder}/$(date +%H%M%S)" +fi -folder="/tmp/showURLimage" filename="${folder}/$(date +%H%M%S)" [ -d "$folder" ] || mkdir -p "$folder" |