1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-03 23:27:32 +02:00

[YoutubeBridge] Fix empty result in search feed (#4098)

This commit is contained in:
Eugene Molotov
2024-05-06 02:30:23 +05:00
committed by GitHub
parent d15960f955
commit f480209825

View File

@@ -193,14 +193,7 @@ class YoutubeBridge extends BridgeAbstract
$html = $this->fetch($url_listing);
$jsonData = $this->extractJsonFromHtml($html);
$jsonData = $jsonData->contents->twoColumnSearchResultsRenderer->primaryContents;
$jsonData = $jsonData->sectionListRenderer->contents;
foreach ($jsonData as $data) {
// Search result includes some ads, have to filter them
if (isset($data->itemSectionRenderer->contents[0]->videoRenderer)) {
$jsonData = $data->itemSectionRenderer->contents;
break;
}
}
$jsonData = $jsonData->sectionListRenderer->contents[0]->itemSectionRenderer->contents;
$this->fetchItemsFromFromJsonData($jsonData);
$this->feeduri = $url_listing;
$this->feedName = 'Search: ' . $search;