From 0bf67413d47d6f19556ae98a1be57f5e6f3c9630 Mon Sep 17 00:00:00 2001 From: Christopher Tarry Date: Sun, 21 Nov 2021 14:31:38 -0500 Subject: [PATCH] fix bug in random UUID generation for Hulu /playlist endpoint --- client/client.go | 2 +- client/types.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 9748c43..5ea0142 100644 --- a/client/client.go +++ b/client/client.go @@ -167,7 +167,7 @@ func (c Client) Playlist(sessionKey int, eabID string) (p Playlist, err error) { randUUID := func() string { randChars := func(n int) (s string) { c := []byte("ABCDEF0123456789") - for i := 0; i < 4; i++ { + for i := 0; i < n; i++ { s += string(c[frand.Intn(len(c))]) } return diff --git a/client/types.go b/client/types.go index b9f23c0..59c518d 100644 --- a/client/types.go +++ b/client/types.go @@ -5,6 +5,7 @@ import ( "time" ) +// These are constants taken from https://player.hulu.com/site/dash/308343-site-curiosity/js/app.js var ( deejayKey = []byte{110, 191, 200, 79, 60, 48, 66, 23, 178, 15, 217, 166, 108, 181, 149, 127} )