From: Andrew Dolgov Date: Tue, 7 Jul 2015 11:21:13 +0000 (+0300) Subject: af_redditimgur: improve youtube detection a bit X-Git-Tag: 16.3~241^2~4 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=f7745af9525b2d35b5cb0891452f3cbeeea56734 af_redditimgur: improve youtube detection a bit --- diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 265999e2..3b37c0a7 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -114,8 +114,8 @@ class Af_RedditImgur extends Plugin { } $matches = array(); - if (preg_match("/\/\/www\.youtube\.com\/v\/([\w-]+)/", $entry->getAttribute("href"), $matches) || - preg_match("/\/\/www\.youtube\.com\/watch\?v=([\w-]+)/", $entry->getAttribute("href"), $matches) || + if (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)) { $vid_id = $matches[1];