diff --git a/lib/routes/youtube/channel.js b/lib/routes/youtube/channel.js
index 08a777096..8aa29586d 100644
--- a/lib/routes/youtube/channel.js
+++ b/lib/routes/youtube/channel.js
@@ -12,18 +12,20 @@ module.exports = async (ctx) => {
title: `${data[0].snippet.channelTitle} 的 Youtube 视频`,
link: `https://www.youtube.com/channel/${id}`,
description: `${data[0].snippet.channelTitle} 的 Youtube 视频`,
- item: data.map((item) => {
- const snippet = item.snippet;
- const videoId = snippet.resourceId.videoId;
- const img = utils.getThumbnail(snippet.thumbnails);
- return {
- title: snippet.title,
- description: `${embed ? '' : ''}${utils.formatDescription(
- snippet.description
- )}
`,
- pubDate: new Date(snippet.publishedAt).toUTCString(),
- link: `https://www.youtube.com/watch?v=${videoId}`,
- };
- }),
+ item: data
+ .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video')
+ .map((item) => {
+ const snippet = item.snippet;
+ const videoId = snippet.resourceId.videoId;
+ const img = utils.getThumbnail(snippet.thumbnails);
+ return {
+ title: snippet.title,
+ description: `${
+ embed ? '' : ''
+ }${utils.formatDescription(snippet.description)}
`,
+ pubDate: new Date(snippet.publishedAt).toUTCString(),
+ link: `https://www.youtube.com/watch?v=${videoId}`,
+ };
+ }),
};
};
diff --git a/lib/routes/youtube/playlist.js b/lib/routes/youtube/playlist.js
index 20a536e8a..66a3dd019 100644
--- a/lib/routes/youtube/playlist.js
+++ b/lib/routes/youtube/playlist.js
@@ -13,7 +13,7 @@ module.exports = async (ctx) => {
link: `https://www.youtube.com/playlist?list=${id}`,
description: `Playlist: ${playlistTitle} by ${data[0].snippet.channelTitle}`,
item: data
- .filter((d) => d.snippet.title !== 'Private video')
+ .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video')
.map((item) => {
const snippet = item.snippet;
const videoId = snippet.resourceId.videoId;
diff --git a/lib/routes/youtube/user.js b/lib/routes/youtube/user.js
index 7a0df544f..6130d205f 100644
--- a/lib/routes/youtube/user.js
+++ b/lib/routes/youtube/user.js
@@ -12,18 +12,20 @@ module.exports = async (ctx) => {
title: `${username} 的 Youtube 视频`,
link: `https://www.youtube.com/user/${username}`,
description: `${username} 的 Youtube 视频`,
- item: data.map((item) => {
- const snippet = item.snippet;
- const videoId = snippet.resourceId.videoId;
- const img = utils.getThumbnail(snippet.thumbnails);
- return {
- title: snippet.title,
- description: `${embed ? '' : ''}${utils.formatDescription(
- snippet.description
- )}
`,
- pubDate: new Date(snippet.publishedAt).toUTCString(),
- link: `https://www.youtube.com/watch?v=${videoId}`,
- };
- }),
+ item: data
+ .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video')
+ .map((item) => {
+ const snippet = item.snippet;
+ const videoId = snippet.resourceId.videoId;
+ const img = utils.getThumbnail(snippet.thumbnails);
+ return {
+ title: snippet.title,
+ description: `${
+ embed ? '' : ''
+ }${utils.formatDescription(snippet.description)}
`,
+ pubDate: new Date(snippet.publishedAt).toUTCString(),
+ link: `https://www.youtube.com/watch?v=${videoId}`,
+ };
+ }),
};
};