fix: skip yt json if absent, fix #3301 (#3302)

This commit is contained in:
Dag 2023-03-11 20:06:01 +01:00 committed by GitHub
parent 1ffb2df46d
commit 2c94791bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,8 +99,11 @@ class YoutubeBridge extends BridgeAbstract
}
$jsonData = $this->getJSONData($html);
$jsonData = $jsonData->contents->twoColumnWatchNextResults->results->results->contents;
if (! isset($jsonData->contents)) {
return;
}
$jsonData = $jsonData->contents->twoColumnWatchNextResults->results->results->contents;
$videoSecondaryInfo = null;
foreach ($jsonData as $item) {
if (isset($item->videoSecondaryInfoRenderer)) {