From 46fd9555fc4aebc64fa69d858df001fd0fd1800d Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Thu, 25 Jul 2024 10:38:10 -0400 Subject: [PATCH 1/3] tests: add a FB reel URL to the tests --- plugins/domains/facebook.com/facebook.video.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/domains/facebook.com/facebook.video.js b/plugins/domains/facebook.com/facebook.video.js index e7c14a68d..7a4b0a94e 100644 --- a/plugins/domains/facebook.com/facebook.video.js +++ b/plugins/domains/facebook.com/facebook.video.js @@ -56,6 +56,7 @@ export default { "https://www.facebook.com/sugarandsoulco/videos/1484037581637646/?pnref=story", "https://www.facebook.com/watch/?v=235613163792499", "https://www.facebook.com/ScottishDailyExpress/videos/former-scottish-conservative-leader-ruth-davidson-opens-up-about-ivf-struggle-wi/1281761502607093/", + "https://www.facebook.com/reel/805139411583688", {noFeeds: true}, {skipMixins: ["fb-error"]} ] }; \ No newline at end of file From 7691eefe508935665db5192a0d503913124796b6 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Wed, 31 Jul 2024 08:14:02 -0400 Subject: [PATCH 2/3] domains: allow broken Instagram image on oEmbed permissions error --- plugins/domains/instagram.com/instagram.com.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/domains/instagram.com/instagram.com.js b/plugins/domains/instagram.com/instagram.com.js index 234c0dd3a..6b2d1f2a6 100644 --- a/plugins/domains/instagram.com/instagram.com.js +++ b/plugins/domains/instagram.com/instagram.com.js @@ -86,7 +86,7 @@ export default { // No media - let's validate image as it may be expired. // Remove below error when and if it's fixed. Validators will remove the link - error: 'Unfortunatelly Instagram\'s OG image is cropped as of 2023-10-11 and as of 2024-02-02' + error: oembed.is_fallback ? null : 'Unfortunatelly Instagram\'s OG image is cropped as of 2023-10-11 and as of 2024-02-02' }); } From 51fcb3f95b5c1e3440dc7cde442fddb9e338b09e Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Wed, 31 Jul 2024 09:30:37 -0400 Subject: [PATCH 3/3] domains: add Loom to public plugins --- plugins/domains/loom.com.js | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/domains/loom.com.js diff --git a/plugins/domains/loom.com.js b/plugins/domains/loom.com.js new file mode 100644 index 000000000..88bf3f75c --- /dev/null +++ b/plugins/domains/loom.com.js @@ -0,0 +1,64 @@ +export default { + + re: /^https?:\/\/(?:www\.)?loom\.com\/share\//i, + + mixins: ['*', 'domain-icon'], + + getLink: function(iframe, query, twitter, options) { + + if (!iframe.width || !iframe.height) { + return; + } + + const width = twitter.player?.width || iframe.width; + const height = twitter.player?.height || iframe.height; + + var hideinfo = options.getRequestOptions('loom.hideinfo', + !options.getProviderOptions('players.showinfo', true) + ) || query._hideinfo === "true" || !!query._hideinfo; + + if (hideinfo) { + query.hide_owner = true; + query.hide_share = true; + query.hide_title = true; + query.hideEmbedTopBar = true; + } + + // Otherwise take only parameters from /embed redirect to /share.... + // but clean them up when user requests via request option + var q = {}; + if (options.getRequestOptions('loom.hideinfo') !== false) { + Object.keys(query).forEach(function(key) { + if (/^hide/.test(key)) { + q[key] = query[key]; + if (!hideinfo) { + hideinfo = true; + } + } + }); + } + + return { + href: iframe.replaceQuerystring(q), + type: CONFIG.T.text_html, // Validator fails because we receive x-frame-options. It actually works fine. + rel: CONFIG.R.player, + 'aspect-ratio': width / height, + options: { + hideinfo: { + value: hideinfo, + label: "Hide player attribution info" + } + } + } + + }, + + tests: [ + // redirects here with the query-string: + 'https://www.loom.com/embed/e5b8c04bca094dd8a5507925ab887002?hide_owner=true&hide_share=true&hide_title=true&hideEmbedTopBar=true', + 'https://www.loom.com/share/0808e55f94a24992b2de488ac56d3815?_hideinfo=true', + 'https://www.loom.com/share/0808e55f94a24992b2de488ac56d3815', + 'https://www.loom.com/share/7f68fa7f01e349cab91b0c36168f68c3' + ] + +}; \ No newline at end of file