Fixes errors with the new youtube music

This commit is contained in:
Michel Fedde 2025-10-22 12:30:14 +02:00
parent 450c17e720
commit 6e303a2ff8
4 changed files with 28 additions and 20 deletions

View file

@ -1,7 +1,13 @@
#!/bin/bash
formatReturn() {
playerctl metadata | jq -R -s -c -r 'split("\n") | map(match("(\\w+) {1}([\\w:]+) {3,}(.+)") | {(.captures[1].string): .captures[2].string}) | add'
targetArtPath="/tmp/.eww.media-art.$(tr -dc 'a-zA-Z0-9' </dev/urandom | head -c 10)"
rm /tmp/.eww.media-art.*
curl $(playerctl metadata mpris:artUrl) -o "$targetArtPath" >/dev/null
playerctl metadata | jq -R -s -c -r --arg artPath "$targetArtPath" 'split("\n") | map(match("(\\w+) {1}([\\w:]+) {3,}(.+)") | {(.captures[1].string): .captures[2].string}) | add | .["mpris:artUrl"] = $artPath'
}