Skip video/audio embeds if og:type exists but does not specify it
This commit is contained in:
parent
7bf4f68ff8
commit
9e13694b21
@ -134,6 +134,19 @@ function parseHtmlMedia($, preview, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let foundMedia = false;
|
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) => {
|
["video", "audio"].forEach((type) => {
|
||||||
if (foundMedia) {
|
if (foundMedia) {
|
||||||
|
Loading…
Reference in New Issue
Block a user