From d43edc045bbc0548e5fc31105fc4c362dc287dde Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 7 Feb 2024 04:09:43 -0800 Subject: fix(hololive): proxy schedule --- src/lib/Utility/proxy.ts | 2 +- src/routes/hololive/+page.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/Utility/proxy.ts b/src/lib/Utility/proxy.ts index 11c87db8..6cf35e96 100644 --- a/src/lib/Utility/proxy.ts +++ b/src/lib/Utility/proxy.ts @@ -1,7 +1,7 @@ import { env } from '$env/dynamic/public'; export const proxy = (url: string, disable = false) => - env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') || disable + env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') && !disable ? url : `https://proxy.due.moe/?q=${url}`; diff --git a/src/routes/hololive/+page.svelte b/src/routes/hololive/+page.svelte index 18f94a4a..2635c01e 100644 --- a/src/routes/hololive/+page.svelte +++ b/src/routes/hololive/+page.svelte @@ -4,6 +4,7 @@ import Skeleton from '$lib/Loading/Skeleton.svelte'; import HeadTitle from '$lib/Home/HeadTitle.svelte'; import { parseScheduleHtml } from '$lib/hololive'; + import proxy from '$lib/Utility/proxy'; interface ParseResult { lives: { @@ -21,7 +22,7 @@ let schedulePromise: Promise; onMount(async () => { - schedulePromise = fetch('https://schedule.hololive.tv', { + schedulePromise = fetch(proxy('https://schedule.hololive.tv'), { headers: { Cookie: 'timezone=Asia/Tokyo' } -- cgit v1.2.3