~shockham/witcht

dc733b45f456b3ed5b6646b159a2cc7dd9d2e4c1 — shockham 1 year, 7 months ago 6ba1fea
fix: update hostname for grabbing stream url
1 files changed, 2 insertions(+), 1 deletions(-)

M main.go
M main.go => main.go +2 -1
@@ 94,13 94,14 @@ type StreamData struct {

func GetStreamUri(channel string, accessToken PlaybackAccessSignature) StreamData {
	rand.Seed(time.Now().UnixNano())
	streamUri := fmt.Sprintf("http://usher.twitch.tv/api/channel/hls/%s.m3u8"+
	streamUri := fmt.Sprintf("http://usher.ttvnw.net/api/channel/hls/%s.m3u8"+
		"?player=twitchweb"+
		"&token=%s"+
		"&sig=%s"+
		"&allow_audio_only=true"+
		"&allow_source=true"+
		"&type=any"+
		"&fast_bread=true"+
		"&p=%d", channel, accessToken.Token, accessToken.Signature, rand.Intn(6))

	req, err := http.NewRequest("GET", streamUri, nil)