From a2aecc207a2bbd103b07fe0100b9dfad14cee803 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 18 Apr 2023 08:48:15 +0800 Subject: [PATCH] ! Fix video comment external link parsing for local API --- 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'))