From: Andrew Dolgov Date: Thu, 9 Jul 2015 12:34:28 +0000 (+0300) Subject: redditimgur: don't try to readability parse youtube, add another youtube embed variant X-Git-Tag: 16.3~237 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9ec9a8f941427573f36fd686e3c291104ec89b85;p=tt-rss.git redditimgur: don't try to readability parse youtube, add another youtube embed variant --- diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 820c45d6..1091f308 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -115,6 +115,7 @@ class Af_RedditImgur extends Plugin { $matches = array(); if (preg_match("/\.youtube\.com\/v\/([\w-]+)/", $entry->getAttribute("href"), $matches) || + preg_match("/\.youtube\.com\/.*?[\&\?]v=([\w-]+)/", $entry->getAttribute("href"), $matches) || preg_match("/\.youtube\.com\/watch\?v=([\w-]+)/", $entry->getAttribute("href"), $matches) || preg_match("/\/\/youtu.be\/([\w-]+)/", $entry->getAttribute("href"), $matches)) { @@ -249,6 +250,7 @@ class Af_RedditImgur extends Plugin { if ($content_link && strpos($content_link->getAttribute("href"), "twitter.com") === FALSE && + strpos($content_link->getAttribute("href"), "youtube.com") === FALSE && strpos($content_link->getAttribute("href"), "reddit.com") === FALSE) { /* link may lead to a huge video file or whatever, we need to check content type before trying to