Skip to content

Commit

Permalink
set clips to use new twitch clips urls. Old clip urls are now using t…
Browse files Browse the repository at this point in the history
…he new clip urls as of this date
  • Loading branch information
teklynk committed Feb 22, 2025
1 parent 08bb085 commit 9ccd581
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ config/.client
config/.secret
config/.domain
getusersubscriptions.php
.env
/vendor
20 changes: 10 additions & 10 deletions public/getuserclips.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

if ($inc_data) {

if (strpos($data['thumbnail_url'], 'https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/') !== false) {
//if (strpos($data['thumbnail_url'], 'https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/') !== false) {


$body = '[{"operationName": "VideoAccessToken_Clip","variables": {"platform": "web","slug": "' . $data['id'] . '"},"extensions": {"persistedQuery": {"version": 1,"sha256Hash": "' . TWITCH_SHA256HASH . '"}}}]';
Expand All @@ -125,12 +125,12 @@

$clip_url = $clips_video_source . '?sig=' . $clips_signature . '&token=' . $clips_token;

} else {
//} else {

// Use the thumbnail url to create the clip url
$clip_url = explode("-preview-", $data['thumbnail_url']);
$clip_url = $clip_url[0] . ".mp4";
}
// $clip_url = explode("-preview-", $data['thumbnail_url']);
// $clip_url = $clip_url[0] . ".mp4";
//}

$itemCount++;

Expand Down Expand Up @@ -221,7 +221,7 @@

foreach ($userData['data'] as $data) {

if (strpos($data['thumbnail_url'], 'https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/') !== false) {
//if (strpos($data['thumbnail_url'], 'https://static-cdn.jtvnw.net/twitch-clips-thumbnails-prod/') !== false) {


$body = '[{"operationName": "VideoAccessToken_Clip","variables": {"platform": "web","slug": "' . $data['id'] . '"},"extensions": {"persistedQuery": {"version": 1,"sha256Hash": "' . TWITCH_SHA256HASH . '"}}}]';
Expand All @@ -246,12 +246,12 @@

$clip_url = $clips_video_source . '?sig=' . $clips_signature . '&token=' . $clips_token;

} else {
//} else {

// Use the thumbnail url to create the clip url
$clip_url = explode("-preview-", $data['thumbnail_url']);
$clip_url = $clip_url[0] . ".mp4";
}
// $clip_url = explode("-preview-", $data['thumbnail_url']);
// $clip_url = $clip_url[0] . ".mp4";
//}

$itemCount++;

Expand Down

0 comments on commit 9ccd581

Please sign in to comment.