From f166f9d2afbc9bd39a58db806fcc659c787f7455 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Thu, 7 May 2020 23:40:35 +0200 Subject: Fixed showURLimage.sh to detect and show thumbnails of youtube videos. --- showURLimage.sh | 7 +++++-- 1 file 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" -- cgit v1.2.1