From 25c9d0e452b07f7a78041bd4046af43e7a64fd82 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Fri, 4 Jul 2025 03:59:20 +0100 Subject: update YouTube API parameter from 'channel' to 'channelHandle' --- source/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source') 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(); -- cgit v1.2.3