From 964bb225fa6781bd1bd64e6b37ed0c080d89737f Mon Sep 17 00:00:00 2001 From: Alex X Date: Tue, 11 Nov 2025 10:54:13 +0300 Subject: [PATCH] Add support custom params for hass source --- internal/hass/hass.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/hass/hass.go b/internal/hass/hass.go index ea172b02..99c63692 100644 --- a/internal/hass/hass.go +++ b/internal/hass/hass.go @@ -7,6 +7,7 @@ import ( "net/http" "os" "path" + "strings" "sync" "github.com/AlexxIT/go2rtc/internal/api" @@ -37,8 +38,13 @@ func Init() { api.HandleFunc("/streams", apiOK) api.HandleFunc("/stream/", apiStream) - streams.RedirectFunc("hass", func(url string) (string, error) { - if location := entities[url[5:]]; location != "" { + streams.RedirectFunc("hass", func(rawURL string) (string, error) { + rawURL, rawQuery, _ := strings.Cut(rawURL, "#") + + if location := entities[rawURL[5:]]; location != "" { + if rawQuery != "" { + return location + "#" + rawQuery, nil + } return location, nil }