From 64bca799ebcd8e803eced254bcc65b87dd8d5c6f Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Fri, 25 Oct 2024 13:05:34 -0400 Subject: [PATCH 1/5] domains: handle Highchart's legacy URL redirects to Everviz --- lib/plugins/system/oembed/providers.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/plugins/system/oembed/providers.json b/lib/plugins/system/oembed/providers.json index 0801fe6c8..0aded34bf 100644 --- a/lib/plugins/system/oembed/providers.json +++ b/lib/plugins/system/oembed/providers.json @@ -1145,9 +1145,10 @@ { "name": "Everviz", "templates": [ - "app.everviz.com/show/([a-zA-Z0-9])+", - "app.everviz.com/embed/([a-zA-Z0-9])+" + "app.everviz.com/show/([a-zA-Z0-9]+)", + "app.everviz.com/embed/([a-zA-Z0-9]+)" ], - "endpoint": "https://api.everviz.com/oembed" + "endpoint": "https://api.everviz.com/oembed", + "url": "https://app.everviz.com/embed/{1}/" } ] \ No newline at end of file From 66a6ef9585eaa450e853778db5d9c3a086f16785 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Fri, 25 Oct 2024 13:07:18 -0400 Subject: [PATCH 2/5] domains: fix for all Highchart's legacy URL patterns --- lib/plugins/system/oembed/providers.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/system/oembed/providers.json b/lib/plugins/system/oembed/providers.json index 0aded34bf..5e40212d6 100644 --- a/lib/plugins/system/oembed/providers.json +++ b/lib/plugins/system/oembed/providers.json @@ -1145,8 +1145,8 @@ { "name": "Everviz", "templates": [ - "app.everviz.com/show/([a-zA-Z0-9]+)", - "app.everviz.com/embed/([a-zA-Z0-9]+)" + "app.everviz.com/show/([a-zA-Z0-9_\\-]+)", + "app.everviz.com/embed/([a-zA-Z0-9_\\-]+)" ], "endpoint": "https://api.everviz.com/oembed", "url": "https://app.everviz.com/embed/{1}/" From e7b04830c89e6b86d769c77bee3b5a9531566a46 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Mon, 28 Oct 2024 08:17:19 -0400 Subject: [PATCH 3/5] domains: fix 500px --- plugins/domains/500px/500px.com.js | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/plugins/domains/500px/500px.com.js b/plugins/domains/500px/500px.com.js index fbda96c37..a427b6f79 100644 --- a/plugins/domains/500px/500px.com.js +++ b/plugins/domains/500px/500px.com.js @@ -4,18 +4,26 @@ export default { mixins: ["*"], - getLinks: function(urlMatch, twitter) { - if (twitter.card === 'photo' && twitter.image) { - return { - template_context: { - title: twitter.title + ' | ' + twitter.site, - img_src: twitter.image.src, - id: urlMatch[1] - }, - type: CONFIG.T.text_html, - rel: [CONFIG.R.image, CONFIG.R.ssl, CONFIG.R.inline], - "aspect-ratio": twitter.image.height ? twitter.image.width / twitter.image.height : null - } + getLinks: function(urlMatch, twitter, utils, options, cb) { + if (twitter.image) { + utils.getImageMetadata(twitter.image, options, function(error, data) { + if (data.width && data.height) { + return cb(null, { + template_context: { + title: twitter.title + ' | ' + twitter.site, + img_src: twitter.image, + id: urlMatch[1] + }, + type: CONFIG.T.text_html, + rel: [CONFIG.R.image, CONFIG.R.ssl, CONFIG.R.inline], + "aspect-ratio": data.width / data.height + }) + } else { + return cb(); + } + }); + } else { + return cb(); } }, From 4a2db7c9f52ae3a04aadb045bb2f3f2518ebef02 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Mon, 28 Oct 2024 09:57:40 -0400 Subject: [PATCH 4/5] domains: review Dailymotion --- .../dailymotion.com/dailymotion.com.js | 8 ++--- .../dailymotion.com/dailymotion.playlist.js | 33 +++++++------------ 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/plugins/domains/dailymotion.com/dailymotion.com.js b/plugins/domains/dailymotion.com/dailymotion.com.js index 1d8ff3425..f15cde587 100644 --- a/plugins/domains/dailymotion.com/dailymotion.com.js +++ b/plugins/domains/dailymotion.com/dailymotion.com.js @@ -10,13 +10,14 @@ export default { "oembed-thumbnail", "domain-icon", "og-description", + "og-image", "canonical", "oembed-iframe", "video" ], getLink: function (url, iframe, options) { - var playlistParams = querystring.parse(options.getProviderOptions('dailymotion.get_params', '').replace(/^\?/, '')); + var playlistParams = querystring.parse(options.getProviderOptions('dailymotion.get_params', 'mute=true').replace(/^\?/, '')); if (iframe.src && iframe.height) { var player = { @@ -24,8 +25,7 @@ export default { type: CONFIG.T.text_html, "rel": [CONFIG.R.player, CONFIG.R.oembed], "aspect-ratio": iframe.width / iframe.height, - scrolling: 'no', - autoplay: "autoplay=1" + autoplay: "mute=false" }; // Do not replace direct link to custom players @@ -70,7 +70,7 @@ export default { } }, { - skipMixins: ["video", "og-description", "canonical"], + skipMixins: ["video", "og-description", "og-image", "canonical"], skipMethods: ["getData"] }, "https://www.dailymotion.com/video/x10bix2_ircam-mani-feste-2013-du-29-mai-au-30-juin-2013_creation#.Uaac62TF1XV", diff --git a/plugins/domains/dailymotion.com/dailymotion.playlist.js b/plugins/domains/dailymotion.com/dailymotion.playlist.js index 4c77e3552..0501fddfd 100644 --- a/plugins/domains/dailymotion.com/dailymotion.playlist.js +++ b/plugins/domains/dailymotion.com/dailymotion.playlist.js @@ -1,34 +1,23 @@ export default { - /** - * Endpoint `http://www.dailymotion.com/services/oembed` - * does not provide oembed results for playlist url currently - */ + // Canonical playlists are covered by oEmbed `http://www.dailymotion.com/services/oembed` re: [ - /^https?:\/\/www\.dailymotion\.com\/playlist\//i, - /^https?:\/\/www\.dailymotion\.com\/embed\/playlist\//i, + /^https?:\/\/www\.dailymotion\.com\/embed\/playlist\/([a-zA-Z0-9]+)(?:\?.+)?$/i, + /^https?:\/\/geo\.dailymotion\.com\/player.html\?playlist=([a-zA-Z0-9]+)(?:&.+)?$/i, ], - mixins: [ - "*" - ], - - getLink: function (url) { - var playlistUrl = url; - if (url.includes('playlist') && !url.includes('embed/playlist')) { - playlistUrl = url.replace('playlist', 'embed/playlist') - } - return { - href: playlistUrl, - type: CONFIG.T.text_html, - rel: [CONFIG.R.player, CONFIG.R.iframely] - }; + getData: function(urlMatch, cb, options) { + cb(!options.redirectsHistory + ? { + redirect: `https://www.dailymotion.com/playlist/${urlMatch[1]}` + } : null); }, tests: [{ noFeeds: true }, - "https://www.dailymotion.com/playlist/x6hynp", - "https://www.dailymotion.com/embed/playlist/x6hynp" + // "https://www.dailymotion.com/playlist/x6hynp", + "https://www.dailymotion.com/embed/playlist/x6hynp", + "https://geo.dailymotion.com/player.html?playlist=x6hynp" ] }; \ No newline at end of file From bb351542af6bec11e8255c44da62278334919a35 Mon Sep 17 00:00:00 2001 From: Ivan Paramonau Date: Mon, 28 Oct 2024 10:32:38 -0400 Subject: [PATCH 5/5] tests: gifs.com is n/a --- plugins/domains/i.gifs.com.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 plugins/domains/i.gifs.com.js diff --git a/plugins/domains/i.gifs.com.js b/plugins/domains/i.gifs.com.js deleted file mode 100644 index aa9fb684e..000000000 --- a/plugins/domains/i.gifs.com.js +++ /dev/null @@ -1,20 +0,0 @@ -export default { - - re: [ - /https?:\/\/j\.gifs\.com\/(\w+)\.gif$/i - ], - - getLink: function(urlMatch, cb) { - - cb ({ - redirect: "https://gifs.com/gif/--" + urlMatch[1] - }); - }, - - tests: [{ - noFeeds: true, - skipMethods: ["getLink"] - }, - "https://j.gifs.com/vM4o5O.gif" - ] -}; \ No newline at end of file