add feedName fallbacks (thanks @Mar-Koeh)

This commit is contained in:
shaun 2025-07-13 20:48:19 -05:00
parent f0202ea893
commit 99c0fe03e0

View file

@ -72,7 +72,11 @@ class YouTubePostsTabBridge extends BridgeAbstract
$json = $this->extractJson($html->find('html', 0)->innertext);
$this->feedName = $json->header->c4TabbedHeaderRenderer->title;
$this->feedName = $json->header->c4TabbedHeaderRenderer->title
?? $json->header->pageHeaderRenderer->pageTitle
?? $json->metadata->channelMetadataRenderer->title
?? $json->microformat->microformatDataRenderer->title
?? '';
if ($this->hasPostsTab($json) === false) {
returnServerError('Channel does not have a posts tab');