From c95ac4e3670b404aef542bb41911fbe5a0aba0e5 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sat, 18 Oct 2025 13:37:46 +0500 Subject: [PATCH] [RutubeBridge] Add fallback method to retrieve videos --- bridges/RutubeBridge.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bridges/RutubeBridge.php b/bridges/RutubeBridge.php index 10fa58c5e2d..c1ba67c9440 100644 --- a/bridges/RutubeBridge.php +++ b/bridges/RutubeBridge.php @@ -85,9 +85,17 @@ private function getVideosFromReduxState() $reduxState = $this->getJSONData($html); $videos = []; if ($this->getInput('c')) { - $videosMethod = 'allVideos(' . $this->getInput('c') . ',)'; + $videosMethod1 = 'allVideos(' . $this->getInput('c') . ',)'; + $videosMethod2 = 'videos(' . $this->getInput('c') . ',)'; + if (isset($reduxState->api->queries->$videosMethod1)) { + $videos = $reduxState->api->queries->$videosMethod1->data->results; + } else { + // Fallback to other method + // No idea what is difference between "allVideos" and "videos" + // Introduced while resolving https://github.com/RSS-Bridge/rss-bridge/issues/4716 + $videos = $reduxState->api->queries->$videosMethod2->data->results; + } $channelInfoMethod = 'channelInfo({"userChannelId":' . $this->getInput('c') . '})'; - $videos = $reduxState->api->queries->$videosMethod->data->results; $this->title = $reduxState->api->queries->$channelInfoMethod->data->name; } elseif ($this->getInput('p')) { $playListVideosMethod = 'getPlaylistVideos(' . $this->getInput('p') . ')';