From 93f4ed0fc38e588a7d010f007fdebba04dbd250e Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 5 Jun 2024 19:13:14 +0800 Subject: [PATCH] feat(youtube): output thumbnail image --- lib/routes/youtube/channel.ts | 1 + lib/routes/youtube/custom.ts | 1 + lib/routes/youtube/live.ts | 1 + lib/routes/youtube/playlist.ts | 1 + lib/routes/youtube/subscriptions.ts | 1 + lib/routes/youtube/user.ts | 1 + 6 files changed, 6 insertions(+) diff --git a/lib/routes/youtube/channel.ts b/lib/routes/youtube/channel.ts index 3ee5d49c4..3ba705afc 100644 --- a/lib/routes/youtube/channel.ts +++ b/lib/routes/youtube/channel.ts @@ -69,6 +69,7 @@ async function handler(ctx) { pubDate: parseDate(snippet.publishedAt), link: `https://www.youtube.com/watch?v=${videoId}`, author: snippet.videoOwnerChannelTitle, + image: img.url, }; }), }; diff --git a/lib/routes/youtube/custom.ts b/lib/routes/youtube/custom.ts index 68d2c175d..33f7fd7ed 100644 --- a/lib/routes/youtube/custom.ts +++ b/lib/routes/youtube/custom.ts @@ -71,6 +71,7 @@ async function handler(ctx) { pubDate: parseDate(snippet.publishedAt), link: `https://www.youtube.com/watch?v=${videoId}`, author: snippet.videoOwnerChannelTitle, + image: img.url, }; }), }; diff --git a/lib/routes/youtube/live.ts b/lib/routes/youtube/live.ts index 5e4ce3f0c..59365f84a 100644 --- a/lib/routes/youtube/live.ts +++ b/lib/routes/youtube/live.ts @@ -68,6 +68,7 @@ async function handler(ctx) { pubDate: parseDate(snippet.publishedAt), guid: liveVideoId, link: `https://www.youtube.com/watch?v=${liveVideoId}`, + image: img.url, }; }), allowEmpty: true, diff --git a/lib/routes/youtube/playlist.ts b/lib/routes/youtube/playlist.ts index cae5d76b8..de688e698 100644 --- a/lib/routes/youtube/playlist.ts +++ b/lib/routes/youtube/playlist.ts @@ -53,6 +53,7 @@ async function handler(ctx) { pubDate: parseDate(snippet.publishedAt), link: `https://www.youtube.com/watch?v=${videoId}`, author: snippet.videoOwnerChannelTitle, + image: img.url, }; }), }; diff --git a/lib/routes/youtube/subscriptions.ts b/lib/routes/youtube/subscriptions.ts index 8932efe20..bf9d44d45 100644 --- a/lib/routes/youtube/subscriptions.ts +++ b/lib/routes/youtube/subscriptions.ts @@ -77,6 +77,7 @@ async function handler(ctx) { pubDate: parseDate(snippet.publishedAt), link: `https://www.youtube.com/watch?v=${videoId}`, author: snippet.videoOwnerChannelTitle, + image: img.url, }; }); diff --git a/lib/routes/youtube/user.ts b/lib/routes/youtube/user.ts index e3a3127ac..290436267 100644 --- a/lib/routes/youtube/user.ts +++ b/lib/routes/youtube/user.ts @@ -73,6 +73,7 @@ async function handler(ctx) { pubDate: parseDate(snippet.publishedAt), link: `https://www.youtube.com/watch?v=${videoId}`, author: snippet.videoOwnerChannelTitle, + image: img.url, }; }), };