From 2e1ef203fd4e5cdfc92d7d40492fbe908dd95699 Mon Sep 17 00:00:00 2001 From: Kelvin <kelvin@revodux.com> Date: Fri, 18 Aug 2023 17:16:06 +0200 Subject: [PATCH] ClaimID Support, temporary wrong ordering --- YoutubeConfig.json | 2 +- YoutubeScript.js | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/YoutubeConfig.json b/YoutubeConfig.json index e393eb5..eb60848 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": 104, + "version": 106, "iconUrl": "./youtube.png", "id": "35ae969a-a7db-11ed-afa1-0242ac120002", diff --git a/YoutubeScript.js b/YoutubeScript.js index a5cd5b8..58e7d5e 100644 --- a/YoutubeScript.js +++ b/YoutubeScript.js @@ -284,10 +284,19 @@ source.getChannelUrlByClaim = (claimType, claimValues) => { return null; const atName = values.find(x=>x.startsWith("@")); if(atName) - return URL_BASE + atName; + return URL_BASE + "/" + atName; else - return URL_BASE + "/c/" + values[0]; -} + return URL_BASE + "/channel/" + values[0]; +} +source.getChannelTemplateByClaimMap = () => { + return { + //Youtube + 2: { //TODO: Ideally these are turned around, requires verifier change.. + 0: URL_BASE + "/channel/{{CLAIMVALUE}}", + 1: URL_BASE + "/{{CLAIMVALUE}}" + } + }; +}; //Video source.isContentDetailsUrl = (url) => { -- GitLab