From 9e0e072532d1e89e8099ef9beede0951d0b67b60 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Fri, 6 Jan 2017 13:07:03 +0100 Subject: spotify-scrobble: improve parsing of title/album that contains double quotes --- spotify-scrobble.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotify-scrobble.sh b/spotify-scrobble.sh index 004b81b..e9675e9 100755 --- a/spotify-scrobble.sh +++ b/spotify-scrobble.sh @@ -36,8 +36,8 @@ do metadata=`dbus-send $DBUS_ARGS string:Metadata` artist=`echo "$metadata" | grep -A2 "\" | tail -n1 | cut -d '"' -f 2` - title=`echo "$metadata" | grep -A1 "\" | tail -n1 | cut -d '"' -f 2` - album=`echo "$metadata" | grep -A1 "\" | tail -n1 | cut -d '"' -f 2` + title=`echo "$metadata" | grep -A1 "\" | tail -n1 | sed 's/.*string \"\(.*\)\"$/\1/g'` + album=`echo "$metadata" | grep -A1 "\" | tail -n1 | sed 's/.*string \"\(.*\)\"$/\1/g'` duration=`echo "$metadata" | grep -A1 "\" | tail -n1 | awk '{ print $3 }'` [ -n "$duration" ] && duration=`expr $duration / 1000000` -- cgit v1.2.3