From 45ecb9d8f5dc866b05705cea240bd9cd800b58f8 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:41:13 -0700 Subject: [PATCH] no more quickwatch api --- src/components/player/hooks/useSkipTime.ts | 104 +++++++++--------- .../player/internals/Backend/SkipTracker.tsx | 6 +- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/components/player/hooks/useSkipTime.ts b/src/components/player/hooks/useSkipTime.ts index 6dabb322..f00cebaf 100644 --- a/src/components/player/hooks/useSkipTime.ts +++ b/src/components/player/hooks/useSkipTime.ts @@ -9,7 +9,7 @@ import { getTurnstileToken } from "@/utils/turnstile"; // Thanks Nemo for this API const THE_INTRO_DB_BASE_URL = "https://api.theintrodb.org/v1"; -const QUICKWATCH_BASE_URL = "https://skips.quickwatch.co"; +// const QUICKWATCH_BASE_URL = "https://skips.quickwatch.co"; const FED_SKIPS_BASE_URL = "https://fed-skips.pstream.mov"; // const VELORA_BASE_URL = "https://veloratv.ru/api/intro-end/confirmed"; const INTRODB_BASE_URL = "https://api.introdb.app/intro"; @@ -20,7 +20,7 @@ let currentSkipTimeSource: | "fed-skips" | "introdb" | "theintrodb" - | "quickwatch" + // | "quickwatch" | null = null; export function useSkipTimeSource(): typeof currentSkipTimeSource { @@ -119,46 +119,46 @@ export function useSkipTime() { // } // }; - const fetchQuickWatchTime = async (): Promise => { - if (!meta?.title || meta.type === "movie") return null; - if (!meta.season?.number || !meta.episode?.number) return null; + // const fetchQuickWatchTime = async (): Promise => { + // if (!meta?.title || meta.type === "movie") return null; + // if (!meta.season?.number || !meta.episode?.number) return null; - try { - const encodedName = encodeURIComponent(meta.title); - const apiUrl = `${QUICKWATCH_BASE_URL}/api/skip-times?name=${encodedName}&season=${meta.season.number}&episode=${meta.episode.number}`; + // try { + // const encodedName = encodeURIComponent(meta.title); + // const apiUrl = `${QUICKWATCH_BASE_URL}/api/skip-times?name=${encodedName}&season=${meta.season.number}&episode=${meta.episode.number}`; - const data = await proxiedFetch(apiUrl); + // const data = await proxiedFetch(apiUrl); - if (!Array.isArray(data) || data.length === 0) return null; + // if (!Array.isArray(data) || data.length === 0) return null; - // Find the first result with intro or credits data - for (const item of data) { - if (item.data) { - // Check for intro end time - if ( - item.data.intro?.end && - typeof item.data.intro.end === "number" - ) { - // Convert milliseconds to seconds - return Math.floor(item.data.intro.end / 1000); - } - // Check for credits start time (use as intro end) - if ( - item.data.credits?.start && - typeof item.data.credits.start === "number" - ) { - // Convert milliseconds to seconds - return Math.floor(item.data.credits.start / 1000); - } - } - } + // // Find the first result with intro or credits data + // for (const item of data) { + // if (item.data) { + // // Check for intro end time + // if ( + // item.data.intro?.end && + // typeof item.data.intro.end === "number" + // ) { + // // Convert milliseconds to seconds + // return Math.floor(item.data.intro.end / 1000); + // } + // // Check for credits start time (use as intro end) + // if ( + // item.data.credits?.start && + // typeof item.data.credits.start === "number" + // ) { + // // Convert milliseconds to seconds + // return Math.floor(item.data.credits.start / 1000); + // } + // } + // } - return null; - } catch (error) { - console.error("Error fetching QuickWatch time:", error); - return null; - } - }; + // return null; + // } catch (error) { + // console.error("Error fetching QuickWatch time:", error); + // return null; + // } + // }; const fetchFedSkipsTime = async (retries = 0): Promise => { if (!meta?.imdbId || meta.type === "movie") return null; @@ -237,21 +237,21 @@ export function useSkipTime() { return; } - // Try QuickWatch API (TV shows only) - convert to intro segment - const quickWatchTime = await fetchQuickWatchTime(); - if (quickWatchTime !== null) { - currentSkipTimeSource = "quickwatch"; - setSegments([ - { - type: "intro", - start_ms: 0, // Assume starts at beginning - end_ms: quickWatchTime * 1000, // Convert seconds to milliseconds - confidence: null, - submission_count: 1, - }, - ]); - return; - } + // QuickWatch API disabled + // const quickWatchTime = await fetchQuickWatchTime(); + // if (quickWatchTime !== null) { + // currentSkipTimeSource = "quickwatch"; + // setSegments([ + // { + // type: "intro", + // start_ms: 0, // Assume starts at beginning + // end_ms: quickWatchTime * 1000, // Convert seconds to milliseconds + // confidence: null, + // submission_count: 1, + // }, + // ]); + // return; + // } // Fall back to Fed-skips if TheIntroDB and QuickWatch don't have anything // Note: Fed-skips only supports TV shows, not movies diff --git a/src/components/player/internals/Backend/SkipTracker.tsx b/src/components/player/internals/Backend/SkipTracker.tsx index 0cf71f55..d193474a 100644 --- a/src/components/player/internals/Backend/SkipTracker.tsx +++ b/src/components/player/internals/Backend/SkipTracker.tsx @@ -19,7 +19,7 @@ interface PendingSkip { startTime: number; endTime: number; hasBackwardMovement: boolean; - skipTimeSource: "fed-skips" | "introdb" | "theintrodb" | "quickwatch" | null; + skipTimeSource: "fed-skips" | "introdb" | "theintrodb" | null; // | "quickwatch" timer: ReturnType; } @@ -77,8 +77,8 @@ export function SkipTracker() { // Only send analytics if skip time came from fed-skips or introdb (not theintrodb) if ( pendingSkip.skipTimeSource === "fed-skips" || - pendingSkip.skipTimeSource === "introdb" || - pendingSkip.skipTimeSource === "quickwatch" + pendingSkip.skipTimeSource === "introdb" + // pendingSkip.skipTimeSource === "quickwatch" ) { // Send analytics sendSkipAnalytics(pendingSkip.skip, adjustedConfidence);