Skip to content

Commit

Permalink
[YoutubeBridge] Fix getURI()
Browse files Browse the repository at this point in the history
  • Loading branch information
csisoap committed Jul 10, 2021
1 parent 076e6ad commit 589c918
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions bridges/YoutubeBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class YoutubeBridge extends BridgeAbstract {
);

private $feedName = '';
private $feeduri = '';
private $feeduri = self::URI;

private function ytBridgeQueryVideoInfo($vid, &$author, &$desc, &$time){
$html = $this->ytGetSimpleHTMLDOM(self::URI . "watch?v=$vid", true);
Expand Down Expand Up @@ -359,6 +359,7 @@ public function collectData(){
} else {
$this->parseJsonPlaylist($jsonData);
}
$this->feeduri = $url_listing;
$this->feedName = 'Playlist: ' . str_replace(' - YouTube', '', $html->find('title', 0)->plaintext); // feedName will be used by getName()
usort($this->items, function ($item1, $item2) {
return $item2['timestamp'] - $item1['timestamp'];
Expand Down Expand Up @@ -397,13 +398,7 @@ private function skipFeeds() {

public function getURI()
{
if (!is_null($this->getInput('p'))) {
return static::URI . 'playlist?list=' . $this->getInput('p');
} elseif(!is_null($this->feeduri)) {
return $this->feeduri;
}

return parent::getURI();
return $this->feed_uri;
}

public function getName(){
Expand Down

0 comments on commit 589c918

Please sign in to comment.