From effb642948d5b0f3bfe7be711279d401434da42c Mon Sep 17 00:00:00 2001 From: unlxam <177877261+unlxam@users.noreply.github.com> Date: Sat, 24 Aug 2024 13:16:02 -0300 Subject: [PATCH] feat: replace View channel on YouTube and channel's description external links --- src/invidious/channels/about.cr | 3 +++ src/invidious/views/components/channel_info.ecr | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invidious/channels/about.cr b/src/invidious/channels/about.cr index 139095279..a64953831 100644 --- a/src/invidious/channels/about.cr +++ b/src/invidious/channels/about.cr @@ -159,6 +159,9 @@ def get_about_info(ucid, locale) : AboutChannel end end + # use comments link_utils to replace external links with the confirmation page + description_html = Invidious::Comments.replace_external_links(description_html) + sub_count = 0 if (metadata_rows = initdata.dig?("header", "pageHeaderRenderer", "content", "pageHeaderViewModel", "metadata", "contentMetadataViewModel", "metadataRows").try &.as_a) diff --git a/src/invidious/views/components/channel_info.ecr b/src/invidious/views/components/channel_info.ecr index f4164f31b..0d9820c5b 100644 --- a/src/invidious/views/components/channel_info.ecr +++ b/src/invidious/views/components/channel_info.ecr @@ -37,7 +37,10 @@
- <%= translate(locale, "View channel on YouTube") %> + <%- + confirm_view_yt = "/confirm_leave?link=#{URI.encode_path(youtube_url)}" + -%> + <%= translate(locale, "View channel on YouTube") %>