[YoutubeBridge] Set icon (#3416)

This commit is contained in:
Ryan Stafford 2023-06-01 15:26:47 -04:00 committed by GitHub
parent 845a8f7936
commit c5cd229445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -336,6 +336,7 @@ class YoutubeBridge extends BridgeAbstract
$html = $this->ytGetSimpleHTMLDOM($url_listing);
$jsonData = $this->getJSONData($html);
$url_feed = $jsonData->metadata->channelMetadataRenderer->rssUrl;
$this->iconURL = $jsonData->metadata->channelMetadataRenderer->avatar->thumbnails[0]->url;
}
if (!$this->skipFeeds()) {
$html = $this->ytGetSimpleHTMLDOM($url_feed);
@ -444,4 +445,13 @@ class YoutubeBridge extends BridgeAbstract
return parent::getName();
}
}
public function getIcon()
{
if (empty($this->iconURL)) {
return parent::getIcon();
} else {
return $this->iconURL;
}
}
}