0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2024-12-22 05:02:58 -05:00

Add cursor

This commit is contained in:
dragongoose 2023-06-02 08:13:36 -04:00
parent b1f8aa87fd
commit 36cc5a0c40
No known key found for this signature in database
GPG key ID: 50DB99B921579009

View file

@ -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
}