Browse Source

[YoutubeBridge] Skip unavailable videos

logmanoriginal 6 years ago
parent
commit
5aaab9eb8c
1 changed files with 6 additions and 0 deletions
  1. 6 0
      bridges/YoutubeBridge.php

+ 6 - 0
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'));