From 9a9ce30b16b5fa9c29e632048f1562c17232ff9f Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 19 Aug 2017 18:51:27 +0200 Subject: [PATCH] [YoutubeBridge] Fix issues loading playlists Videos that are part of a playlist have the playlist ID encoded in the URI. When loading the video info the page contents change unex- pectedly due to the playlist being part of the page. This removes any trailing parameters from the video ID in order to ensure only pure videos are loaded at all times. --- bridges/YoutubeBridge.php | 1 + 1 file changed, 1 insertion(+) diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index 1e5f0212..37ee7c72 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -102,6 +102,7 @@ class YoutubeBridge extends BridgeAbstract { $desc = ''; $time = 0; $vid = str_replace('/watch?v=', '', $element->find('a', 0)->href); + $vid = substr($vid, 0, strpos($vid, '&') ?: strlen($vid)); $title = $this->ytBridgeFixTitle($element->find($title_selector, 0)->plaintext); if($title != '[Private Video]') { $this->ytBridgeQueryVideoInfo($vid, $author, $desc, $time);