]> git.wh0rd.org - tt-rss.git/commitdiff
redditimgur: don't try to readability parse youtube, add another youtube embed variant
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 9 Jul 2015 12:34:28 +0000 (15:34 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 9 Jul 2015 12:34:28 +0000 (15:34 +0300)
plugins/af_redditimgur/init.php

index 820c45d670a4db21b4ff3c89d7876b516161f11f..1091f3088f6c52052fbb6a944ff04d1691f0fcb6 100644 (file)
@@ -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