aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-02-07 01:19:26 -0800
committerFuwn <[email protected]>2024-02-07 01:19:26 -0800
commit64cab1d1b09f65689a57e0cb8c0d91106f842501 (patch)
tree53e80b55e34a665587303bdbbd2ebae1d41cb09c /src/routes
parentfeat(hololive): re-implement get schedule html (diff)
downloaddue.moe-64cab1d1b09f65689a57e0cb8c0d91106f842501.tar.xz
due.moe-64cab1d1b09f65689a57e0cb8c0d91106f842501.zip
revert: "feat(hololive): re-implement get schedule html"
This reverts commit 1aa2a1eaa539dfe2028237058c0e3318f34aa05e.
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/api/hololive/+server.ts24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/routes/api/hololive/+server.ts b/src/routes/api/hololive/+server.ts
index 8cf3fbca..331d776a 100644
--- a/src/routes/api/hololive/+server.ts
+++ b/src/routes/api/hololive/+server.ts
@@ -1,20 +1,10 @@
import parseScheduleHtml from 'holo-schedule';
+import getScheduleHtml from 'holo-schedule/lib/getScheduleHtml';
-export const GET = async ({ url }) =>
- Response.json(
- parseScheduleHtml(
- await (
- await fetch('https://schedule.hololive.tv', {
- headers: {
- Cookie: `timezone=${url.searchParams.get('timezone') || 'Asia/Tokyo'}`
- }
- })
- ).text()
- ),
- {
- headers: {
- 'Access-Control-Allow-Origin': 'https://due.moe',
- 'Cache-Control': 'public, max-age=300, s-maxage=300'
- }
+export const GET = async () =>
+ Response.json(parseScheduleHtml(await getScheduleHtml()), {
+ headers: {
+ 'Access-Control-Allow-Origin': 'https://due.moe',
+ 'Cache-Control': 'public, max-age=300, s-maxage=300'
}
- );
+ });