From f5d709b66a67f3c7ec8ef652b6814159cafedde5 Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 31 Aug 2025 00:25:39 +0800 Subject: [PATCH] fix(route/youtube): fix community post url (#19935) --- lib/routes/youtube/community.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/youtube/community.ts b/lib/routes/youtube/community.ts index 860e0e798..817408e58 100644 --- a/lib/routes/youtube/community.ts +++ b/lib/routes/youtube/community.ts @@ -1,6 +1,6 @@ import { Route } from '@/types'; -import got from '@/utils/got'; +import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; @@ -12,7 +12,7 @@ export const route: Route = { categories: ['social-media'], example: '/youtube/community/@JFlaMusic', parameters: { handle: 'YouTube handles or channel id' }, - name: 'Community', + name: 'Community Posts', maintainers: ['TonyRL'], handler, }; @@ -25,7 +25,7 @@ async function handler(ctx) { urlPath = `channel/${handle}`; } - const { data: response } = await got(`https://www.youtube.com/${urlPath}/community`); + const response = await ofetch(`https://www.youtube.com/${urlPath}/posts`); const $ = load(response); const ytInitialData = JSON.parse( $('script') @@ -62,7 +62,7 @@ async function handler(ctx) { }); return { - title: `${username} - Community - YouTube`, + title: `${username} - Community Posts- YouTube`, link: channelMetadata.channelUrl, description: channelMetadata.description, item: items,