I can't seem to find this anywhere so it might be just me, but sometimes the $INFO for the com.spotify.client.PlaybackStateChanged event comes back malformed, either with additional closing backets and/or invalid characters almost always at the end of the $INFO json. This usually results in jq parse errors.
I can't seem to find this anywhere so it might be just me, but sometimes the
$INFO
for thecom.spotify.client.PlaybackStateChanged
event comes back malformed, either with additional closing backets and/or invalid characters almost always at the end of the $INFO json. This usually results in jq parse errors.Unsure if anyone else has encountered this.
Example malformed (printed $INFO into a file)
I usually have to santinize the output before I can
jq
it without errors with this line.SPOTIFY_JSON="{$(echo $INFO | iconv -f utf-8 -t utf-8 -c | cut -d'}' -f1 | cut -d'{' -f2)}"