1
0
Fork 0
forked from blallo/rss-bridge

[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.
This commit is contained in:
logmanoriginal 2017-08-19 18:51:27 +02:00
parent 0e2b80d5d7
commit 9a9ce30b16

View file

@ -102,6 +102,7 @@ class YoutubeBridge extends BridgeAbstract {
$desc = ''; $desc = '';
$time = 0; $time = 0;
$vid = str_replace('/watch?v=', '', $element->find('a', 0)->href); $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); $title = $this->ytBridgeFixTitle($element->find($title_selector, 0)->plaintext);
if($title != '[Private Video]') { if($title != '[Private Video]') {
$this->ytBridgeQueryVideoInfo($vid, $author, $desc, $time); $this->ytBridgeQueryVideoInfo($vid, $author, $desc, $time);