From 5aaab9eb8ccac18f5d8358e6d35bf0348bc06bc6 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 16 Feb 2018 22:11:03 +0100 Subject: [PATCH] [YoutubeBridge] Skip unavailable videos --- bridges/YoutubeBridge.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index 3d81dae..b10db9e 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -50,6 +50,12 @@ class YoutubeBridge extends BridgeAbstract { private function ytBridgeQueryVideoInfo($vid, &$author, &$desc, &$time){ $html = $this->ytGetSimpleHTMLDOM(self::URI . "watch?v=$vid"); + + // Skip unavailable videos + if(!strpos($html->innertext, 'IS_UNAVAILABLE_PAGE')){ + return; + } + $author = $html->innertext; $author = substr($author, strpos($author, '"author=') + 8); $author = substr($author, 0, strpos($author, '\u0026'));