add template parsing

This commit is contained in:
seydx
2025-05-20 23:07:04 +02:00
parent 24310e2f7a
commit e0687db9e2
2 changed files with 48 additions and 0 deletions
+13
View File
@@ -4,6 +4,7 @@ import (
"errors"
"strings"
"github.com/AlexxIT/go2rtc/internal/app"
"github.com/AlexxIT/go2rtc/pkg/core"
)
@@ -46,6 +47,18 @@ func GetProducer(url string) (core.Producer, error) {
}
if handler, ok := handlers[scheme]; ok {
index := strings.IndexByte(url, '#')
if index > 0 {
_, query := url[:index], ParseQuery(url[index+1:])
secretsName := query.Get("secrets")
if secretsName != "" {
secrets := app.GetSecret(secretsName)
if secrets != nil {
url = secrets.Parse(url)
}
}
}
return handler(url)
}
}