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.

require token for skip time

Pas d8abfdb8 a2df05b1

+12
+12
src/components/player/hooks/useSkipTime.ts
··· 3 3 import { usePlayerMeta } from "@/components/player/hooks/usePlayerMeta"; 4 4 import { conf } from "@/setup/config"; 5 5 6 + const getUserToken = (): string | null => { 7 + try { 8 + return typeof window !== "undefined" 9 + ? window.localStorage.getItem("febbox_ui_token") 10 + : null; 11 + } catch (e) { 12 + console.warn("Unable to access localStorage:", e); 13 + return null; 14 + } 15 + }; 16 + 6 17 // Thanks Nemo for this API 7 18 const BASE_URL = "https://skips.pstream.org"; 8 19 const MAX_RETRIES = 3; ··· 15 26 const fetchSkipTime = async (retries = 0): Promise<void> => { 16 27 if (!meta?.imdbId || meta.type === "movie") return; 17 28 if (!conf().ALLOW_FEBBOX_KEY) return; 29 + if (!getUserToken()) return; 18 30 19 31 try { 20 32 const apiUrl = `${BASE_URL}/${meta.imdbId}/${meta.season?.number}/${meta.episode?.number}`;