From dd662ff77b5dc0a078810c1c93854f0cce8669dc Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 18 Sep 2024 17:05:37 +0200 Subject: [PATCH] feat: add support for AllTube download links Introduce an optional feature to generate download links using AllTube if the alltube_url configuration is set. This provides users with an alternative download method, enhancing the functionality and offering more flexibility. Ensures compatibility with existing download disabling configuration. --- src/invidious/frontend/watch_page.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/invidious/frontend/watch_page.cr b/src/invidious/frontend/watch_page.cr index c8cb7110..aed00c0b 100644 --- a/src/invidious/frontend/watch_page.cr +++ b/src/invidious/frontend/watch_page.cr @@ -19,6 +19,10 @@ module Invidious::Frontend::WatchPage end def download_widget(locale : String, video : Video, video_assets : VideoAssets) : String + if CONFIG.alltube_url + return "#{translate(locale, "Download with AllTube")}" + end + if CONFIG.disabled?("downloads") return "

#{translate(locale, "Download is disabled")}

" end