From f9649d4dfd5481ef6c7dbcf22deba1b8076d2b6a Mon Sep 17 00:00:00 2001 From: Logan Rockmore Date: Tue, 5 Jan 2021 11:30:43 -0500 Subject: [PATCH] Standardize the titles and descriptions for the YouTube RSS feeds. --- lib/routes/youtube/channel.js | 4 ++-- lib/routes/youtube/playlist.js | 4 ++-- lib/routes/youtube/user.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/routes/youtube/channel.js b/lib/routes/youtube/channel.js index 006940e3c..fb44c7817 100644 --- a/lib/routes/youtube/channel.js +++ b/lib/routes/youtube/channel.js @@ -13,9 +13,9 @@ module.exports = async (ctx) => { const data = (await utils.getPlaylistItems(playlistId, 'snippet,contentDetails')).data.items; ctx.state.data = { - title: `${data[0].snippet.channelTitle} 的 YouTube 视频`, + title: `${data[0].snippet.channelTitle} - YouTube`, link: `https://www.youtube.com/channel/${id}`, - description: `${data[0].snippet.channelTitle} 的 YouTube 视频`, + description: `YouTube channel ${data[0].snippet.channelTitle}`, item: data .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video') .map((item) => { diff --git a/lib/routes/youtube/playlist.js b/lib/routes/youtube/playlist.js index bfd420f62..89e796a8a 100644 --- a/lib/routes/youtube/playlist.js +++ b/lib/routes/youtube/playlist.js @@ -15,9 +15,9 @@ module.exports = async (ctx) => { const authors = (await utils.getVideoAuthor(ids, 'snippet')).data.items; ctx.state.data = { - title: `Playlist: ${playlistTitle} by ${data[0].snippet.channelTitle}`, + title: `${playlistTitle} by ${data[0].snippet.channelTitle} - YouTube`, link: `https://www.youtube.com/playlist?list=${id}`, - description: `Playlist: ${playlistTitle} by ${data[0].snippet.channelTitle}`, + description: `YouTube playlist ${playlistTitle} by ${data[0].snippet.channelTitle}`, item: data.map((item, index) => { const snippet = item.snippet; const videoId = snippet.resourceId.videoId; diff --git a/lib/routes/youtube/user.js b/lib/routes/youtube/user.js index 969466f16..0d84cddab 100644 --- a/lib/routes/youtube/user.js +++ b/lib/routes/youtube/user.js @@ -13,9 +13,9 @@ module.exports = async (ctx) => { const data = (await utils.getPlaylistItems(playlistId, 'snippet,contentDetails')).data.items; ctx.state.data = { - title: `${username} 的 YouTube 视频`, + title: `${username} - YouTube`, link: `https://www.youtube.com/user/${username}`, - description: `${username} 的 YouTube 视频`, + description: `YouTube user ${username}`, item: data .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video') .map((item) => {