diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2025-07-04 03:59:20 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2025-07-04 03:59:20 +0100 |
| commit | 25c9d0e452b07f7a78041bd4046af43e7a64fd82 (patch) | |
| tree | d626c4d913a7fd085692242ee09c2aa7c3b09cb9 /source/main.js | |
| parent | d906faa870ee24d473f24bef153d577b9d12d884 (diff) | |
| download | zue.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'
Diffstat (limited to 'source/main.js')
| -rw-r--r-- | source/main.js | 10 |
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(); |
