repo: music action: commit revision: path_from: revision_from: 17332b75d8a01f29eef22f8c5959baa0b9b9b12d: path_to: revision_to:
commit 17332b75d8a01f29eef22f8c5959baa0b9b9b12d Author: epochDate: Thu Jul 30 08:19:09 2020 -0500 added an HTTP header you can pass to get the album art sent with the icy-title as sixels diff --git a/music-stream b/music-stream
--- a/music-stream
+++ b/music-stream
@@ -3,9 +3,19 @@ set -eo pipefail
logger -p info -n logserver "new listener! ${NCAT_REMOTE_ADDR}:${NCAT_REMOTE_PORT}"
icy_metaint=16384
while read -t 2 LINE;do
- printf "%s\n" "$LINE"
-done \
- | if stdbuf -oL grep -i "Icy-Metadata:" | stdbuf -oL cut -d: -f2- | stdbuf -oL grep 1 >/dev/null;then
+# printf "%s\n" "$LINE"
+ if printf "%s\n" "$LINE" | grep -i "^Icy-Metadata: " | cut -d: -f2- | grep 1 >/dev/null;then
+ export want_icy=1
+ fi
+ if printf "%s\n" "$LINE" | grep -i "^Sixel-Albumart: " | cut -d: -f2- | grep 1 >/dev/null;then
+ export want_six=1
+ fi
+ if [ "$LINE" = $'\r' ];then
+ break
+ fi
+done
+
+if [ "$want_icy" = "1" ];then
printf "HTTP/1.1 200 OK\r\n"
printf "icy-metaint: %s\r\n" "${icy_metaint}"
printf "Content-Type: audio/ogg\r\n\r\n"
-----END OF PAGE-----