pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update traktApi.ts

Pas c907ef0c dd2422f8

+19 -4
+19 -4
src/backend/metadata/traktApi.ts
··· 1 1 import { SimpleCache } from "@/utils/cache"; 2 + import { getTurnstileToken } from "@/utils/turnstile"; 2 3 3 4 import { getMediaDetails } from "./tmdb"; 4 5 import { TMDBContentTypes, TMDBMovieData } from "./types/tmdb"; ··· 60 61 return cachedResult as T; 61 62 } 62 63 63 - // Make the API request 64 - const response = await fetch(`${TRAKT_BASE_URL}${endpoint}`); 64 + // Get Turnstile token for verification 65 + const turnstileToken = await getTurnstileToken("0x4AAAAAAB6ocCCpurfWRZyC"); 66 + 67 + // Make the API request with Turnstile token 68 + const response = await fetch(`${TRAKT_BASE_URL}${endpoint}`, { 69 + headers: { 70 + "cf-turnstile-response": turnstileToken, 71 + }, 72 + }); 65 73 if (!response.ok) { 66 74 throw new Error(`Failed to fetch from ${endpoint}: ${response.statusText}`); 67 75 } ··· 91 99 return cachedResult as TraktReleaseResponse; 92 100 } 93 101 94 - // Make the API request 95 - const response = await fetch(`${TRAKT_BASE_URL}${url}`); 102 + // Get Turnstile token for verification 103 + const turnstileToken = await getTurnstileToken("0x4AAAAAAB6ocCCpurfWRZyC"); 104 + 105 + // Make the API request with Turnstile token 106 + const response = await fetch(`${TRAKT_BASE_URL}${url}`, { 107 + headers: { 108 + "cf-turnstile-response": turnstileToken, 109 + }, 110 + }); 96 111 if (!response.ok) { 97 112 throw new Error(`Failed to fetch release details: ${response.statusText}`); 98 113 }