Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nleush committed Oct 7, 2024
2 parents 1bac52e + 1d9662f commit 8d704fc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"iframely"
],

KNOWN_VIDEO_SOURCES: /(youtube|youtu|youtube\-nocookie|vimeo|dailymotion|theplatform|jwplatform|jwplayer|cnevids|newsinc|podbean|simplecast|libsyn|wistia|podiant|art19|kaltura|mtvnservices|brightcove|bcove|soundcloud|giphy|viddler|flowplayer|vidible|bandzoogle|podigee|smugmug|facebook|vid|ultimedia|mixcloud|vidyard|youplay|streamable|captivate|mdstrm|mediadelivery)\.\w+\//i,
KNOWN_VIDEO_SOURCES: /(youtube|youtu|youtube\-nocookie|vimeo|dailymotion|theplatform|jwplatform|jwplayer|cnevids|newsinc|podbean|simplecast|libsyn|wistia|podiant|art19|kaltura|mtvnservices|brightcove|bcove|soundcloud|giphy|viddler|flowplayer|vidible|bandzoogle|podigee|smugmug|facebook|vid|ultimedia|mixcloud|vidyard|youplay|streamable|captivate|mdstrm|mediadelivery|hearstapps)\.\w+\//i,

OEMBED_RELS_PRIORITY: ["app", "player", "survey", "image", "reader"],
OEMBED_RELS_MEDIA_PRIORITY: ["player", "survey", "image", "reader", "app"],
Expand Down
13 changes: 7 additions & 6 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1293,12 +1293,13 @@ function getWhitelistLogData(meta, oembed, uri) {

var ld = meta.ld;
if (ld) {
var json = ld.videoobject
|| ld.mediaobject
|| (ld.newsarticle && (ld.newsarticle.video || ld.newsarticle.videoobject))
|| (ld.tvepisode && (ld.tvepisode.video || ld.tvepisode.videoobject))
|| (ld.movie && (ld.movie.video || ld.movie.videoobject))
|| (ld.tvclip && (ld.tvclip.video || ld.tvclip.videoobject));
var json = ld.videoobject || ld.mediaobject;
if (!json) { // try to find video attached to main object
var mainObjWithVideo = ld && Object.values(ld).find((obj) => obj.video || obj.videoobject);
if (mainObjWithVideo) {
json = mainObjWithVideo.video || mainObjWithVideo.videoobject;
}
}

if (json) {
var embedURL = json.embedurl || json.embedUrl || json.embedURL || json.contenturl || json.contentUrl || json.contentURL;
Expand Down
2 changes: 1 addition & 1 deletion plugins/domains/flickr.com/flickr.gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
return {
html: html
.replace(/\@n/g, "@N")
.replace(/width=\"\d+\" height=\"\d+\" alt/, 'width="100%" alt'),
.replace(/width=[\'\"]\d+[\'\"] height=[\'\"]\d+[\'\"] alt/, 'width="100%" alt'),
rel: [CONFIG.R.player, CONFIG.R.slideshow, CONFIG.R.ssl, CONFIG.R.inline],
type: CONFIG.T.text_html,
"aspect-ratio": oembed.width / oembed.height,
Expand Down
20 changes: 14 additions & 6 deletions plugins/links/embedURL/ld-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ export default {

getData: function(ld, whitelistRecord, url) {

var json = ld.videoobject
|| ld.mediaobject
|| (ld.newsarticle && (ld.newsarticle.video || ld.newsarticle.videoobject))
|| (ld.tvepisode && (ld.tvepisode.video || ld.tvepisode.videoobject))
|| (ld.movie && (ld.movie.video || ld.movie.videoobject))
|| (ld.tvclip && (ld.tvclip.video || ld.tvclip.videoobject));
var json = ld.videoobject || ld.mediaobject;

/*
|| (ld.newsarticle && (ld.newsarticle.video || ld.newsarticle.videoobject))
|| (ld.tvepisode && (ld.tvepisode.video || ld.tvepisode.videoobject))
|| (ld.movie && (ld.movie.video || ld.movie.videoobject))
|| (ld.tvclip && (ld.tvclip.video || ld.tvclip.videoobject));
*/
if (!json) { // try to find video attached to main object
var mainObjWithVideo = ld && Object.values(ld).find((obj) => obj.video || obj.videoobject);
if (mainObjWithVideo) {
json = mainObjWithVideo.video || mainObjWithVideo.videoobject;
}
}

if (json) {

Expand Down
2 changes: 1 addition & 1 deletion plugins/links/hosted/known-players.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {


// or DailyMotion, e.g. Liberation, Le Point, L'Express
urlMatch = video_src.match(/^(?:https?:)?\/\/(?:www\.)?dailymotion\.com\/(?:swf|embed)?\/?video\/([_a-zA-Z0-9\-]+)/i)
urlMatch = video_src.match(/^(?:https?:)?\/\/(?:www\.)?dailymotion\.com\/(?:swf|embed|crawler)?\/?video\/([_a-zA-Z0-9\-]+)/i)
|| video_src.match(/^(?:https?:)?\/\/(?:www\.)?dailymotion\.com\/swf\/([_a-zA-Z0-9\-]+)/i)
|| video_src.match(/^(?:https?:)?\/\/dai.ly\/([_a-zA-Z0-9\-]+)/i) // e.g. Libération.fr
|| video_src.match(/^https?:\/\/(?:geo\.)?dailymotion\.com\/player\.html\?video=([a-zA-Z0-9]+)/i);
Expand Down

0 comments on commit 8d704fc

Please sign in to comment.