Merge pull request #6617 from loganrockmore/embed_or_image

Only show the YouTube thumbnail image if the video is not embedded.
This commit is contained in:
NeverBehave 2021-01-10 19:57:00 -05:00 committed by GitHub
commit 1864041f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -25,8 +25,8 @@ module.exports = async (ctx) => {
return {
title: snippet.title,
description: `${
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''
}${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'
}${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
};

View File

@ -24,8 +24,8 @@ module.exports = async (ctx) => {
const img = utils.getThumbnail(snippet.thumbnails);
return {
title: snippet.title,
description: `${embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''}
${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
description: `${embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'}
${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
author: authors[index].snippet.channelTitle,

View File

@ -25,8 +25,8 @@ module.exports = async (ctx) => {
return {
title: snippet.title,
description: `${
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''
}${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'
}${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
};