From b9278682389e88ecc8ad33ad6ab023aa852fed83 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Fri, 13 Dec 2024 21:33:10 -0500 Subject: [PATCH 1/4] domains: fix legacy c-span urls --- plugins/domains/c-span.org/c-span.org-options.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/domains/c-span.org/c-span.org-options.js b/plugins/domains/c-span.org/c-span.org-options.js index 32becd6bc..32caf3f96 100644 --- a/plugins/domains/c-span.org/c-span.org-options.js +++ b/plugins/domains/c-span.org/c-span.org-options.js @@ -4,5 +4,6 @@ export default { getData: function(url, options) { options.exposeStatusCode = true; + options.followHTTPRedirect=true } }; \ No newline at end of file From 346e3e061da7b07683195745d57813bcba407044 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Fri, 13 Dec 2024 21:35:57 -0500 Subject: [PATCH 2/4] iframely protocol: support publishers with custom domain names --- plugins/links/iframely-link.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/links/iframely-link.js b/plugins/links/iframely-link.js index 66aabd749..65f5cc09a 100644 --- a/plugins/links/iframely-link.js +++ b/plugins/links/iframely-link.js @@ -7,7 +7,7 @@ export default { if (appname) { appname = appname.toLowerCase(); } - + let ignoreIframely = false; let links = []; @@ -15,13 +15,22 @@ export default { ignoreIframely = true; } - for (const [key, value] of Object.entries(meta)) { + for (const [key, v] of Object.entries(meta)) { if (key.indexOf(appname) === 0 || (!ignoreIframely && key.indexOf(CONFIG.R.iframely) === 0)) { + + const value = typeof(v) === 'string' ? {href: v} : v; // If link has no `media` and no `type` attributes, HTMLMetaHandler assigns the value=href; + + let wlr = whitelistRecord; + if (whitelistRecord.isDefault + && !Array.isArray(value) && value.href) { + wlr = options.getWhitelistRecord(value.href, {exclusiveRel: 'html-meta'}); + } + links = links.concat( utils.parseMetaLinks( key, - typeof(value) === 'string' ? {href: value} : value, // If link has no `media` and no `type` attributes, HTMLMetaHandler assigns the value=href; - whitelistRecord, + value, + wlr, ignoreIframely && appname ) ); From 1dffa7d5ef5cc415669c18030f667f0c3121a1fc Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Mon, 16 Dec 2024 10:09:36 -0500 Subject: [PATCH 3/4] Iframely protocol: add an extra type validation for publishers with custom domain names --- plugins/links/iframely-link.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/links/iframely-link.js b/plugins/links/iframely-link.js index 65f5cc09a..a601bc561 100644 --- a/plugins/links/iframely-link.js +++ b/plugins/links/iframely-link.js @@ -22,7 +22,8 @@ export default { let wlr = whitelistRecord; if (whitelistRecord.isDefault - && !Array.isArray(value) && value.href) { + && !Array.isArray(value) && value.href + && (!value.type || value.type === CONFIG.T.text_html)) { wlr = options.getWhitelistRecord(value.href, {exclusiveRel: 'html-meta'}); } From 93520453be161f7dc72024a4c10e24b147eb84d8 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Tue, 17 Dec 2024 08:32:50 -0500 Subject: [PATCH 4/4] domains: cnn addition videos no longer provides embed codes --- plugins/domains/cnn.com.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 plugins/domains/cnn.com.js diff --git a/plugins/domains/cnn.com.js b/plugins/domains/cnn.com.js deleted file mode 100644 index db27981e1..000000000 --- a/plugins/domains/cnn.com.js +++ /dev/null @@ -1,36 +0,0 @@ -export default { - - re: [ - /^https?:\/\/(www|edition)?\.?cnn\.com\/videos?\//i, - ], - - mixins: [ - "*" - ], - - getLink: function(og, urlMatch) { - - if (!/video/.test(og.type) || !og.url) { - return; - } - - var path = ((og.video && og.video.url) || og.url).replace (/^https?:\/\/www\.cnn\.com\/videos?(\/#\/video)?\//i, ""); - - return { - href: "//fave.api.cnn.io/v1/fav/?customer=cnn&env=prod&video=" + path, - accept: CONFIG.T.text_html, - rel: CONFIG.R.player, - "aspect-ratio": 416 / 234 - }; - }, - - tests: [{ - noFeeds: true - }, - "http://www.cnn.com/videos/world/2015/06/05/orig-200-pound-ripped-kangaroo-crushes-metal-video.cnn", - "http://edition.cnn.com/videos/tv/2015/10/30/spc-the-circuit-felipe-massa-versus-felipe-nasr.cnn", - "http://edition.cnn.com/video/shows/anthony-bourdain-parts-unknown/season-3/mexico/index.html", - "http://www.cnn.com/video/shows/anthony-bourdain-parts-unknown/season-2/copenhagen/index.html", - "http://www.cnn.com/videos/health/2017/03/14/iceland-genes-disease-research-health-sje-mobile-orig.cnn" - ] -}; \ No newline at end of file