diff --git a/YoutubeConfig.json b/YoutubeConfig.json index fac48d5f48b4b7b29fcb969d38b812e87d021bb8..1e6178035a9840eb422d54949adac2b377a5dcbc 100644 --- a/YoutubeConfig.json +++ b/YoutubeConfig.json @@ -7,7 +7,7 @@ "sourceUrl": "https://plugins.grayjay.app/Youtube/YoutubeConfig.json", "repositoryUrl": "https://futo.org", "scriptUrl": "./YoutubeScript.js", - "version": 182, + "version": 183, "iconUrl": "./youtube.png", "id": "35ae969a-a7db-11ed-afa1-0242ac120002", diff --git a/YoutubeScript.js b/YoutubeScript.js index 21acf078183c594193f648d6890758470ad480c5..7531cdcc69a9976b4a74f658534d8d434f8324e7 100644 --- a/YoutubeScript.js +++ b/YoutubeScript.js @@ -239,6 +239,12 @@ source.getTrending = () => { if(bridge.devSubmit) bridge.devSubmit("getTrending - No tabs found..", JSON.stringify(initialData)); throw new ScriptException("No tabs found.."); } + let tab = tabs[0]; + if (tab.videos.length === 0) { + if (tab.shelves.length > 0) { + tab = tab.shelves[0]; + } + } return new RichGridPager(tabs[0], {}, USE_MOBILE_PAGES, false); };