aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2025-07-04 03:59:20 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2025-07-04 03:59:20 +0100
commit25c9d0e452b07f7a78041bd4046af43e7a64fd82 (patch)
treed626c4d913a7fd085692242ee09c2aa7c3b09cb9
parentd906faa870ee24d473f24bef153d577b9d12d884 (diff)
downloadzue.dev-25c9d0e452b07f7a78041bd4046af43e7a64fd82.tar
zue.dev-25c9d0e452b07f7a78041bd4046af43e7a64fd82.tar.gz
zue.dev-25c9d0e452b07f7a78041bd4046af43e7a64fd82.tar.bz2
zue.dev-25c9d0e452b07f7a78041bd4046af43e7a64fd82.tar.xz
zue.dev-25c9d0e452b07f7a78041bd4046af43e7a64fd82.zip
update YouTube API parameter from 'channel' to 'channelHandle'
-rw-r--r--source/main.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/main.js b/source/main.js
index 7b50662..15848a5 100644
--- a/source/main.js
+++ b/source/main.js
@@ -166,9 +166,9 @@ export default {
case "/96/youtube/latest-video":
return (async () => {
const url = new URL(request.url);
- const channel = url.searchParams.get("channel");
+ const channelHandle = url.searchParams.get("channelHandle");
- if (!channel)
+ if (!channelHandle)
return new Response(
JSON.stringify({
error: `channel not provided`,
@@ -181,9 +181,9 @@ export default {
}
);
- const channelWhitelist = ["@vtsweets"];
+ const channelHandleWhitelist = ["@vtsweets"];
- if (!channelWhitelist.includes(channel))
+ if (!channelHandleWhitelist.includes(channelHandle))
return new Response(
JSON.stringify({
error: `channel not allowed`,
@@ -214,7 +214,7 @@ export default {
);
const youtubeChannelsListResponse = await fetch(
- `https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forHandle=${channel}&key=${API_Key}`
+ `https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forHandle=${channelHandle}&key=${API_Key}`
);
const youtubeChannelsList = await youtubeChannelsListResponse.json();