diff --git a/scripts/imgurl.sh b/scripts/imgurl.sh index f416814..e921a4c 100755 --- a/scripts/imgurl.sh +++ b/scripts/imgurl.sh @@ -1,4 +1,8 @@ #!/bin/bash -imgurl=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | egrep -A 1 "artUrl" | egrep -v "artUrl"| cut -b 44- | cut -d '"' -f 1` +trackid=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | egrep -A 1 "trackid" | egrep -v "trackid"| cut -b 44- | cut -d '"' -f 1` +#echo $trackid +oembed_url="https://open.spotify.com/oembed?url=$trackid" +#echo $oembed_url +imgurl=`curl -s $oembed_url | jq '.thumbnail_url' | tr -d '"'` echo $imgurl