1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:35:55 +00:00

Merge branch 'master' into master

This commit is contained in:
kdan
2021-05-11 11:05:20 +03:00
5 changed files with 38 additions and 19 deletions

View File

@@ -425,13 +425,7 @@ class Af_RedditImgur extends Plugin {
}
$matches = array();
if (!$found && (preg_match("/youtube\.com\/v\/([\w-]+)/", $entry_href, $matches) ||
preg_match("/youtube\.com\/.*?[\&\?]v=([\w-]+)/", $entry_href, $matches) ||
preg_match("/youtube\.com\/embed\/([\w-]+)/", $entry_href, $matches) ||
preg_match("/youtube\.com\/watch\?v=([\w-]+)/", $entry_href, $matches) ||
preg_match("/\/\/youtu.be\/([\w-]+)/", $entry_href, $matches))) {
$vid_id = $matches[1];
if (!$found && $vid_id = UrlHelper::url_to_youtube_vid($entry_href)) {
Debug::log("Handling as youtube: $vid_id", Debug::LOG_VERBOSE);

View File

@@ -16,18 +16,16 @@ class Af_Youtube_Embed extends Plugin {
}
function hook_iframe_whitelisted($src) {
return in_array($src, ["www.youtube.com", "youtube.com", "youtu.be"]);
return in_array($src, ["www.youtube.com", "youtube.com",
"www.youtube-nocookie.com", "youtube-nocookie.com",
"youtu.be"]);
}
function hook_render_enclosure($entry, $hide_images) {
$matches = array();
$url = $entry["content_url"];
if (preg_match("/\/\/www\.youtube\.com\/v\/([\w-]+)/", $entry["content_url"], $matches) ||
preg_match("/\/\/www\.youtube\.com\/watch?v=([\w-]+)/", $entry["content_url"], $matches) ||
preg_match("/\/\/youtu.be\/([\w-]+)/", $entry["content_url"], $matches)) {
$vid_id = $matches[1];
if ($vid_id = UrlHelper::url_to_youtube_vid($url)) {
return "<div class='embed-responsive'>
<iframe class='youtube-player'