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

no more quickwatch api

Pas 45ecb9d8 6f67a7c7

+55 -55
+52 -52
src/components/player/hooks/useSkipTime.ts
··· 9 9 10 10 // Thanks Nemo for this API 11 11 const THE_INTRO_DB_BASE_URL = "https://api.theintrodb.org/v1"; 12 - const QUICKWATCH_BASE_URL = "https://skips.quickwatch.co"; 12 + // const QUICKWATCH_BASE_URL = "https://skips.quickwatch.co"; 13 13 const FED_SKIPS_BASE_URL = "https://fed-skips.pstream.mov"; 14 14 // const VELORA_BASE_URL = "https://veloratv.ru/api/intro-end/confirmed"; 15 15 const INTRODB_BASE_URL = "https://api.introdb.app/intro"; ··· 20 20 | "fed-skips" 21 21 | "introdb" 22 22 | "theintrodb" 23 - | "quickwatch" 23 + // | "quickwatch" 24 24 | null = null; 25 25 26 26 export function useSkipTimeSource(): typeof currentSkipTimeSource { ··· 119 119 // } 120 120 // }; 121 121 122 - const fetchQuickWatchTime = async (): Promise<number | null> => { 123 - if (!meta?.title || meta.type === "movie") return null; 124 - if (!meta.season?.number || !meta.episode?.number) return null; 122 + // const fetchQuickWatchTime = async (): Promise<number | null> => { 123 + // if (!meta?.title || meta.type === "movie") return null; 124 + // if (!meta.season?.number || !meta.episode?.number) return null; 125 125 126 - try { 127 - const encodedName = encodeURIComponent(meta.title); 128 - const apiUrl = `${QUICKWATCH_BASE_URL}/api/skip-times?name=${encodedName}&season=${meta.season.number}&episode=${meta.episode.number}`; 126 + // try { 127 + // const encodedName = encodeURIComponent(meta.title); 128 + // const apiUrl = `${QUICKWATCH_BASE_URL}/api/skip-times?name=${encodedName}&season=${meta.season.number}&episode=${meta.episode.number}`; 129 129 130 - const data = await proxiedFetch(apiUrl); 130 + // const data = await proxiedFetch(apiUrl); 131 131 132 - if (!Array.isArray(data) || data.length === 0) return null; 132 + // if (!Array.isArray(data) || data.length === 0) return null; 133 133 134 - // Find the first result with intro or credits data 135 - for (const item of data) { 136 - if (item.data) { 137 - // Check for intro end time 138 - if ( 139 - item.data.intro?.end && 140 - typeof item.data.intro.end === "number" 141 - ) { 142 - // Convert milliseconds to seconds 143 - return Math.floor(item.data.intro.end / 1000); 144 - } 145 - // Check for credits start time (use as intro end) 146 - if ( 147 - item.data.credits?.start && 148 - typeof item.data.credits.start === "number" 149 - ) { 150 - // Convert milliseconds to seconds 151 - return Math.floor(item.data.credits.start / 1000); 152 - } 153 - } 154 - } 134 + // // Find the first result with intro or credits data 135 + // for (const item of data) { 136 + // if (item.data) { 137 + // // Check for intro end time 138 + // if ( 139 + // item.data.intro?.end && 140 + // typeof item.data.intro.end === "number" 141 + // ) { 142 + // // Convert milliseconds to seconds 143 + // return Math.floor(item.data.intro.end / 1000); 144 + // } 145 + // // Check for credits start time (use as intro end) 146 + // if ( 147 + // item.data.credits?.start && 148 + // typeof item.data.credits.start === "number" 149 + // ) { 150 + // // Convert milliseconds to seconds 151 + // return Math.floor(item.data.credits.start / 1000); 152 + // } 153 + // } 154 + // } 155 155 156 - return null; 157 - } catch (error) { 158 - console.error("Error fetching QuickWatch time:", error); 159 - return null; 160 - } 161 - }; 156 + // return null; 157 + // } catch (error) { 158 + // console.error("Error fetching QuickWatch time:", error); 159 + // return null; 160 + // } 161 + // }; 162 162 163 163 const fetchFedSkipsTime = async (retries = 0): Promise<number | null> => { 164 164 if (!meta?.imdbId || meta.type === "movie") return null; ··· 237 237 return; 238 238 } 239 239 240 - // Try QuickWatch API (TV shows only) - convert to intro segment 241 - const quickWatchTime = await fetchQuickWatchTime(); 242 - if (quickWatchTime !== null) { 243 - currentSkipTimeSource = "quickwatch"; 244 - setSegments([ 245 - { 246 - type: "intro", 247 - start_ms: 0, // Assume starts at beginning 248 - end_ms: quickWatchTime * 1000, // Convert seconds to milliseconds 249 - confidence: null, 250 - submission_count: 1, 251 - }, 252 - ]); 253 - return; 254 - } 240 + // QuickWatch API disabled 241 + // const quickWatchTime = await fetchQuickWatchTime(); 242 + // if (quickWatchTime !== null) { 243 + // currentSkipTimeSource = "quickwatch"; 244 + // setSegments([ 245 + // { 246 + // type: "intro", 247 + // start_ms: 0, // Assume starts at beginning 248 + // end_ms: quickWatchTime * 1000, // Convert seconds to milliseconds 249 + // confidence: null, 250 + // submission_count: 1, 251 + // }, 252 + // ]); 253 + // return; 254 + // } 255 255 256 256 // Fall back to Fed-skips if TheIntroDB and QuickWatch don't have anything 257 257 // Note: Fed-skips only supports TV shows, not movies
+3 -3
src/components/player/internals/Backend/SkipTracker.tsx
··· 19 19 startTime: number; 20 20 endTime: number; 21 21 hasBackwardMovement: boolean; 22 - skipTimeSource: "fed-skips" | "introdb" | "theintrodb" | "quickwatch" | null; 22 + skipTimeSource: "fed-skips" | "introdb" | "theintrodb" | null; // | "quickwatch" 23 23 timer: ReturnType<typeof setTimeout>; 24 24 } 25 25 ··· 77 77 // Only send analytics if skip time came from fed-skips or introdb (not theintrodb) 78 78 if ( 79 79 pendingSkip.skipTimeSource === "fed-skips" || 80 - pendingSkip.skipTimeSource === "introdb" || 81 - pendingSkip.skipTimeSource === "quickwatch" 80 + pendingSkip.skipTimeSource === "introdb" 81 + // pendingSkip.skipTimeSource === "quickwatch" 82 82 ) { 83 83 // Send analytics 84 84 sendSkipAnalytics(pendingSkip.skip, adjustedConfidence);