mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2024-12-22 05:02:58 -05:00
1080p support for streams and vods
This commit is contained in:
parent
927c3fc3d5
commit
05f86dfd6b
3 changed files with 3 additions and 10 deletions
|
@ -1,8 +1,6 @@
|
|||
package twitch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
|
@ -49,8 +47,6 @@ func getPlaybackAccessToken(streamerName string, vodID string) (PlaybackAccessTo
|
|||
return PlaybackAccessToken{}, err
|
||||
}
|
||||
|
||||
fmt.Println(string(body))
|
||||
|
||||
var token string
|
||||
var signature string
|
||||
if isLive {
|
||||
|
|
|
@ -14,13 +14,10 @@ func GetStream(streamerName string) (string, error) {
|
|||
signature := tokenwsig.Signature
|
||||
|
||||
playlistUrl := "https://usher.ttvnw.net/api/channel/hls/" + strings.ToLower(streamerName) + ".m3u8"
|
||||
params := "?sig=" + signature + "&token=" + token
|
||||
params := fmt.Sprintf("?sig=%s&token=%s&acmb=e30=&allow_source=true&fast_bread=true&p=4189675&player_backend=mediaplayer&playlist_include_framerate=true&reassignments_supported=true&transcode_mode=cbr_v1&cdm=wv&player_version=1.20.0", signature, token)
|
||||
|
||||
req, err := http.NewRequest("GET", playlistUrl+params, nil)
|
||||
req.Header.Add("Client-Id", "ue6666qo983tsx6so1t0vnawi233wa")
|
||||
|
||||
fmt.Println(req.URL.String())
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -53,8 +53,8 @@ func GetVODPlaylist(vodID string) ([]byte, error) {
|
|||
return []byte{}, err
|
||||
}
|
||||
|
||||
params := "?token=" + tokens.Token + "&sig=" + tokens.Signature
|
||||
req, err := http.NewRequest("GET", "https://usher.ttvnw.net/vod/"+fmt.Sprint(vodID)+".m3u8"+params, nil)
|
||||
params := fmt.Sprintf("?sig=%s&token=%s&acmb=e30=&allow_source=true&fast_bread=true&p=4189675&player_backend=mediaplayer&playlist_include_framerate=true&reassignments_supported=true&transcode_mode=cbr_v1&cdm=wv&player_version=1.20.0", tokens.Signature, tokens.Token)
|
||||
req, err := http.NewRequest("GET", fmt.Sprintf("https://usher.ttvnw.net/vod/%s.m3u8%s", fmt.Sprint(vodID), params), nil)
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue