From 1d5bd1d959189cf98700eaa8027d6e4dd01a164d Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Wed, 25 Mar 2020 13:52:00 +0100 Subject: Updated showURLImage.sh to get youtube thumbnails. --- showURLimage.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'showURLimage.sh') diff --git a/showURLimage.sh b/showURLimage.sh index 2d5b485..cd7db1f 100755 --- a/showURLimage.sh +++ b/showURLimage.sh @@ -1,7 +1,14 @@ #!/bin/sh # Downloads an url to /tmp and opens it with sxiv. +# If the url is from youtube tries to download the thumbnail. + +url="$1" +echo "$url" | grep -i "youtube" >/dev/null && + url="$(youtube-dl --get-thumbnail "$url")" filename="/tmp/showURLimage$(date +%H%M%S)" -curl "$1" > "$filename" -sxiv -b -N "sxivfloat" "$filename" || notify-send "No image found at $1" + +curl "$url" > "$filename" +sxiv -b -N "sxivfloat" "$filename" || notify-send "No image found at $url" + -- cgit v1.2.1