diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 841f0500..861e13fb 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -131,9 +131,23 @@ function parseHtmlMedia($, preview, client) { return new Promise((resolve, reject) => { if (Helper.config.disableMediaPreview) { reject(); + return; } let foundMedia = false; + const openGraphType = $('meta[property="og:type"]').attr("content"); + + // Certain news websites may include video and audio tags, + // despite actually being an article (as indicated by og:type). + // If there is og:type tag, we will only select video or audio if it matches + if ( + openGraphType && + !openGraphType.startsWith("video") && + !openGraphType.startsWith("music") + ) { + reject(); + return; + } ["video", "audio"].forEach((type) => { if (foundMedia) {