Skip to content

Commit 20f9184

Browse files
committed
broadcast arsing: implement token_redirect
1 parent 994ece7 commit 20f9184

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/demoinfocs/cstv/cstv.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"io"
88
"net/http"
9+
"net/url"
910
"time"
1011

1112
"github.com/pkg/errors"
@@ -23,6 +24,7 @@ type sync struct {
2324
KeyframeInterval int `json:"keyframe_interval"`
2425
Map string `json:"map"`
2526
Protocol int `json:"protocol"`
27+
TokenRedirect string `json:"token_redirect"`
2628
}
2729

2830
type Reader struct {
@@ -107,6 +109,11 @@ func NewReader(baseUrl string, timeout time.Duration) (*Reader, error) {
107109
return nil, fmt.Errorf("failed to decode response from %q: %w", syncUrl, err)
108110
}
109111

112+
baseUrl, err = url.JoinPath(baseUrl, s.TokenRedirect)
113+
if err != nil {
114+
return nil, fmt.Errorf("failed to join base url and token redirect: %w", err)
115+
}
116+
110117
startUrl := fmt.Sprintf(baseUrl+"/%d/start", s.SignupFragment)
111118

112119
startResp, err := http.Get(startUrl)

0 commit comments

Comments
 (0)