mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-22 11:28:36 +00:00
[YouTubeFeedExpanderBridge] More reliable channel icons (#4622)
This commit is contained in:
parent
52be29d3ec
commit
3517cda4a5
@ -38,12 +38,7 @@ class YouTubeFeedExpanderBridge extends FeedExpander
|
||||
{
|
||||
if ($this->getInput('channel') != null) {
|
||||
$html = getSimpleHTMLDOMCached($this->getURI());
|
||||
$scriptRegex = '/var ytInitialData = (.*?);<\/script>/';
|
||||
$result = preg_match($scriptRegex, $html, $matches);
|
||||
if (isset($matches[1])) {
|
||||
$json = json_decode($matches[1]);
|
||||
return $json->metadata->channelMetadataRenderer->avatar->thumbnails[0]->url;
|
||||
}
|
||||
return $html->find('[itemprop="thumbnailUrl"]', 0)->href;
|
||||
}
|
||||
return parent::getIcon();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user