* The enable endpoint gets an integrity token. These integrity tokens must be passed into the stream playback access token endpoint. The integrity endpoint always returns a token but it is not always valid. Valid tokens work for 16 hours. Valid tokens are generated through a kasada challenge. The way to tell if a token is invalid is to try an endpoint and see if it fails.
description:`${clip.game.displayName}\nClipped by ${clip.curator.displayName}`,
video:newVideoSourceDescriptor(sources),
})
}
/**
* Returns a saved video
* @param {string} url
...
...
@@ -197,7 +292,7 @@ source.getUserSubscriptions = function () {
*/
functiongetSavedVideo(url){
// get whatever is after the last slash in twitch.tv/videos/____/
constid=url.split('/').pop()
constid=extractTwitchVideoId(url)
// query as written: '# This query name is VERY IMPORTANT. # # There is code in twilight-apollo to split links such that # this query is NOT batched in an effort to retain snappy TTV. query PlaybackAccessToken($login: String! $isLive: Boolean! $vodID: ID! $isVod: Boolean! $playerType: String!) { streamPlaybackAccessToken(channelName: $login params: {platform: "web" playerBackend: "mediaplayer" playerType: $playerType}) @include(if: $isLive) { value signature } videoPlaybackAccessToken(id: $vodID params: {platform: "web" playerBackend: "mediaplayer" playerType: $playerType}) @include(if: $isVod) { value signature } }'
constgql1=[
...
...
@@ -302,7 +397,8 @@ function getSavedVideo(url) {
*/
functiongetLiveVideo(url,video_details=true){
// get whatever is after the last slash in twitch.tv/_____/
constlogin=url.split('/').pop()
constlogin=extractChannelId(url);
constgql_for_metadata=[
{
operationName:'StreamMetadata',
...
...
@@ -398,10 +494,10 @@ function getLiveVideo(url, video_details = true) {