diff --git a/YoutubeConfig.json b/YoutubeConfig.json index e93dc372005074a48e9bece5fcc450e70b001ba6..fa55d7f839b58557874b9929ba590f25f4b0d95f 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": 127, + "version": 128, "iconUrl": "./youtube.png", "id": "35ae969a-a7db-11ed-afa1-0242ac120002", diff --git a/YoutubeScript.js b/YoutubeScript.js index c2573967a277407955325b8d6c84a583eb6e12c2..0fd9c4bd31466f45aeb0df7e11b9eccf57720018 100644 --- a/YoutubeScript.js +++ b/YoutubeScript.js @@ -690,6 +690,8 @@ source.getChannelContents = (url, type, order, filters) => { log("USING AUTH FOR CHANNEL"); const initialData = requestInitialData(url, false, useAuth); + if(!initialData) + throw new ScriptException("No channel data found for: " + url); const channel = extractChannel_PlatformChannel(initialData, url); const contextData = { authorLink: new PlatformAuthorLink(new PlatformID(PLATFORM, channel.id.value, config.id, PLATFORM_CLAIMTYPE), channel.name, channel.url, channel.thumbnail) @@ -1884,10 +1886,10 @@ function extractSearch_SearchResults(data, contextData) { * @returns {PlatformChannel} */ function extractChannel_PlatformChannel(initialData, sourceUrl = null) { - const headerRenderer = initialData.header?.c4TabbedHeaderRenderer; + const headerRenderer = initialData?.header?.c4TabbedHeaderRenderer; if(!headerRenderer) { log("Missing header renderer in structure: (" + sourceUrl + ")\n" + JSON.stringify(initialData, null, " ")); - throw new ScriptException("No header renderer"); + throw new ScriptException("No header renderer for " + sourceUrl); }