diff --git a/extractor/twitch/twitchExtractor.go b/extractor/twitch/twitchExtractor.go index 8870d76..6f4e4e5 100644 --- a/extractor/twitch/twitchExtractor.go +++ b/extractor/twitch/twitchExtractor.go @@ -191,6 +191,7 @@ func GetDiscoveryPage(limit int, cursor string) ([]structs.CategoryPreview, erro "sort": "RELEVANCE", "tags": []string{}, }, + "cursor": cursor, }, "extensions": map[string]interface{}{ "persistedQuery": map[string]interface{}{ @@ -225,6 +226,7 @@ func GetDiscoveryItem(name string, streamLimit int, cursor string) (structs.Cate { "operationName": "DirectoryPage_Game", "variables": map[string]interface{}{ + "cursor": cursor, "imageWidth": 50, "name": name, "options": map[string]interface{}{ @@ -411,7 +413,29 @@ func GetStream(streamerName string) (string, error) { // holy zooks, what the scallop??? we got the playlist, houston!!! // time to proxy all the urls!!! - proxiedPlaylist := ProxyPlaylistFile(string(playlistFile)) + proxiedPlaylist := ProxyPlaylistFile(string(playlistFile), false) return proxiedPlaylist, nil } + +func GetSubPlaylist(rawurl string) (string, error) { + req, err := http.NewRequest("GET", rawurl, nil) + + req.Header.Add("Client-Id", "ue6666qo983tsx6so1t0vnawi233wa") + if err != nil { + return "", err + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return "", err + } + + playlistFile, err := io.ReadAll(resp.Body) + if err != nil { + return "", err + } + + proxiedPlaylist := ProxyPlaylistFile(string(playlistFile), true) + return proxiedPlaylist, nil +}