mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-26 03:16:33 +03:00
[YoutubeBridge] Fix empty result in search feed (#4098)
This commit is contained in:
parent
d15960f955
commit
f480209825
1 changed files with 1 additions and 8 deletions
|
@ -193,14 +193,7 @@ class YoutubeBridge extends BridgeAbstract
|
||||||
$html = $this->fetch($url_listing);
|
$html = $this->fetch($url_listing);
|
||||||
$jsonData = $this->extractJsonFromHtml($html);
|
$jsonData = $this->extractJsonFromHtml($html);
|
||||||
$jsonData = $jsonData->contents->twoColumnSearchResultsRenderer->primaryContents;
|
$jsonData = $jsonData->contents->twoColumnSearchResultsRenderer->primaryContents;
|
||||||
$jsonData = $jsonData->sectionListRenderer->contents;
|
$jsonData = $jsonData->sectionListRenderer->contents[0]->itemSectionRenderer->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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->fetchItemsFromFromJsonData($jsonData);
|
$this->fetchItemsFromFromJsonData($jsonData);
|
||||||
$this->feeduri = $url_listing;
|
$this->feeduri = $url_listing;
|
||||||
$this->feedName = 'Search: ' . $search;
|
$this->feedName = 'Search: ' . $search;
|
||||||
|
|
Loading…
Reference in a new issue