Release v1.0.4: OAuth statt Zeroconf
Zeroconf/mDNS schlägt in Containern fehl weil Port 5353 vom Host (systemd-resolved/avahi) bereits belegt ist. mdns-sd kann den Socket nicht teilen → librespot: 'discovery disabled'. Lösung: OAuth-Authentifizierung (der offiziell unterstützte Weg in librespot 0.7+). Das Gerät registriert sich bei Spotifys Servern und erscheint ohne lokales mDNS in der Spotify-App. - --disable-discovery + --enable-oauth + --system-cache /data/librespot-cache - Credentials werden in /data persistent gespeichert (data:rw) - Beim ersten Start: URL im Log → Browser öffnen → Spotify autorisieren - Ab dem zweiten Start: direkt mit gecachten Credentials Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "Busch-Radio Spotify Bridge"
|
name: "Busch-Radio Spotify Bridge"
|
||||||
version: "1.0.3"
|
version: "1.0.4"
|
||||||
slug: busch_radio_spotify
|
slug: busch_radio_spotify
|
||||||
description: >
|
description: >
|
||||||
Streamt Spotify-Musik als Internet-Radio-Stream für das Busch-Jäger Unterputz-Internetradio.
|
Streamt Spotify-Musik als Internet-Radio-Stream für das Busch-Jäger Unterputz-Internetradio.
|
||||||
@@ -42,3 +42,4 @@ panel_title: "Busch-Radio"
|
|||||||
map:
|
map:
|
||||||
- config:rw
|
- config:rw
|
||||||
- share:rw
|
- share:rw
|
||||||
|
- data:rw
|
||||||
|
|||||||
@@ -134,19 +134,39 @@ if ! kill -0 "${ICECAST_PID}" 2>/dev/null; then
|
|||||||
fi
|
fi
|
||||||
bashio::log.info "Icecast läuft (PID: ${ICECAST_PID})"
|
bashio::log.info "Icecast läuft (PID: ${ICECAST_PID})"
|
||||||
|
|
||||||
|
# ── Credential-Cache-Verzeichnis ─────────────────────────────────────────────
|
||||||
|
# Credentials werden in /data gespeichert (persistentes Add-on Verzeichnis).
|
||||||
|
CREDENTIAL_CACHE="/data/librespot-cache"
|
||||||
|
mkdir -p "${CREDENTIAL_CACHE}"
|
||||||
|
|
||||||
# ── Librespot-Argumente zusammenstellen ───────────────────────────────────────
|
# ── Librespot-Argumente zusammenstellen ───────────────────────────────────────
|
||||||
# Hinweis: librespot 0.7+ unterstützt keine Passwort-Authentifizierung mehr.
|
# Zeroconf/mDNS funktioniert nicht zuverlässig in Containern, da Port 5353
|
||||||
# Das Gerät wird automatisch via Zeroconf/mDNS im lokalen Netz gefunden.
|
# vom Host (systemd-resolved/avahi) bereits belegt ist.
|
||||||
# Die Spotify-App zeigt es als verfügbares Abspielgerät an.
|
# Stattdessen: OAuth-Authentifizierung. Das Gerät registriert sich bei
|
||||||
|
# Spotifys Servern und erscheint in der App ohne lokales mDNS.
|
||||||
LIBRESPOT_ARGS=(
|
LIBRESPOT_ARGS=(
|
||||||
"--name" "${DEVICE_NAME}"
|
"--name" "${DEVICE_NAME}"
|
||||||
"--bitrate" "${BITRATE}"
|
"--bitrate" "${BITRATE}"
|
||||||
"--backend" "pipe"
|
"--backend" "pipe"
|
||||||
"--disable-audio-cache"
|
"--disable-audio-cache"
|
||||||
"--initial-volume" "100"
|
"--initial-volume" "100"
|
||||||
|
"--disable-discovery"
|
||||||
|
"--enable-oauth"
|
||||||
|
"--system-cache" "${CREDENTIAL_CACHE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
bashio::log.info "Authentifizierung: Zeroconf/mDNS (automatische Erkennung im Netz)"
|
# Prüfen ob bereits Credentials gecacht sind
|
||||||
|
if [ -f "${CREDENTIAL_CACHE}/credentials.json" ]; then
|
||||||
|
bashio::log.info "Gespeicherte Credentials gefunden – Direktstart."
|
||||||
|
else
|
||||||
|
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
bashio::log.info "ERSTER START – Spotify-Autorisierung erforderlich!"
|
||||||
|
bashio::log.info ""
|
||||||
|
bashio::log.info "librespot gibt gleich eine URL aus. Öffne diese"
|
||||||
|
bashio::log.info "im Browser und melde dich mit deinem Spotify-Konto an."
|
||||||
|
bashio::log.info "Danach startet das Add-on automatisch durch."
|
||||||
|
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
fi
|
||||||
|
|
||||||
# ── Icecast-Source-URL ────────────────────────────────────────────────────────
|
# ── Icecast-Source-URL ────────────────────────────────────────────────────────
|
||||||
ICECAST_SOURCE_URL="icecast://source:${ICECAST_PASSWORD}@localhost:${STREAM_PORT}${STREAM_MOUNT}"
|
ICECAST_SOURCE_URL="icecast://source:${ICECAST_PASSWORD}@localhost:${STREAM_PORT}${STREAM_MOUNT}"
|
||||||
|
|||||||
Reference in New Issue
Block a user