summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2017-01-06 13:07:03 +0100
committerReiner Herrmann <reiner@reiner-h.de>2017-01-06 13:07:03 +0100
commit9e0e072532d1e89e8099ef9beede0951d0b67b60 (patch)
tree75bbd996b0765deaaefea73cc451d74da298ae5f
parentac5a18a0345b397ed915cac9060316fea35b2cdc (diff)
spotify-scrobble: improve parsing of title/album that contains double quotes
-rwxr-xr-xspotify-scrobble.sh4
1 files 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 "\<artist\>" | tail -n1 | cut -d '"' -f 2`
- title=`echo "$metadata" | grep -A1 "\<title\>" | tail -n1 | cut -d '"' -f 2`
- album=`echo "$metadata" | grep -A1 "\<album\>" | tail -n1 | cut -d '"' -f 2`
+ title=`echo "$metadata" | grep -A1 "\<title\>" | tail -n1 | sed 's/.*string \"\(.*\)\"$/\1/g'`
+ album=`echo "$metadata" | grep -A1 "\<album\>" | tail -n1 | sed 's/.*string \"\(.*\)\"$/\1/g'`
duration=`echo "$metadata" | grep -A1 "\<length\>" | tail -n1 | awk '{ print $3 }'`
[ -n "$duration" ] && duration=`expr $duration / 1000000`