From 0e2b80d5d7a1794edc81270e722374eb9c615e8b Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Thu, 17 Aug 2017 19:26:01 +0200 Subject: [PATCH] [YoutubeBridge] Fix error on certain keywords References #569 --- bridges/YoutubeBridge.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index dab32529..1e5f0212 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -53,8 +53,12 @@ class YoutubeBridge extends BridgeAbstract { $author = $html->innertext; $author = substr($author, strpos($author, '"author=') + 8); $author = substr($author, 0, strpos($author, '\u0026')); - $desc = $html->find('div#watch-description-text', 0)->innertext; - $time = strtotime($html->find('meta[itemprop=datePublished]', 0)->getAttribute('content')); + + if(!is_null($html->find('div#watch-description-text', 0))) + $desc = $html->find('div#watch-description-text', 0)->innertext; + + if(!is_null($html->find('meta[itemprop=datePublished]', 0))) + $time = strtotime($html->find('meta[itemprop=datePublished]', 0)->getAttribute('content')); } private function ytBridgeAddItem($vid, $title, $author, $desc, $time){