From f6d8e78d256e9e81e8ec81a1ba167768ce07d27a Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Wed, 26 Apr 2023 08:01:06 +0800 Subject: [PATCH] ! Fix video comment external link parsing for local API (#3448) --- src/renderer/helpers/api/local.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index ed372667a456f..7068a867096e0 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -527,7 +527,7 @@ export function parseLocalTextRuns(runs, emojiSize = 16, options = { looseChanne break case 'WEB_PAGE_TYPE_UNKNOWN': default: { - const url = new URL(endpoint.payload.url) + const url = new URL(endpoint.payload?.content?.confirmDialogRenderer?.confirmButton?.buttonRenderer?.command?.urlEndpoint?.url || endpoint.payload.url) if (url.hostname === 'www.youtube.com' && url.pathname === '/redirect' && url.searchParams.has('q')) { // remove utm tracking parameters const realURL = new URL(url.searchParams.get('q'))