1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-05 08:07:33 +02:00

[YouTubeFeedExpanderBridge] More reliable channel icons (#4622)

This commit is contained in:
July
2025-08-03 18:17:30 -04:00
committed by GitHub
parent 52be29d3ec
commit 3517cda4a5

View File

@@ -38,12 +38,7 @@ class YouTubeFeedExpanderBridge extends FeedExpander
{ {
if ($this->getInput('channel') != null) { if ($this->getInput('channel') != null) {
$html = getSimpleHTMLDOMCached($this->getURI()); $html = getSimpleHTMLDOMCached($this->getURI());
$scriptRegex = '/var ytInitialData = (.*?);<\/script>/'; return $html->find('[itemprop="thumbnailUrl"]', 0)->href;
$result = preg_match($scriptRegex, $html, $matches);
if (isset($matches[1])) {
$json = json_decode($matches[1]);
return $json->metadata->channelMetadataRenderer->avatar->thumbnails[0]->url;
}
} }
return parent::getIcon(); return parent::getIcon();
} }