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.
This commit is contained in:
parent
4d2b8e9d15
commit
dd662ff77b
1 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,10 @@ module Invidious::Frontend::WatchPage
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_widget(locale : String, video : Video, video_assets : VideoAssets) : String
|
def download_widget(locale : String, video : Video, video_assets : VideoAssets) : String
|
||||||
|
if CONFIG.alltube_url
|
||||||
|
return "<a href=\"#{CONFIG.alltube_url}#{env.request.resource}\" target=\"_blank\">#{translate(locale, "Download with AllTube")}</a>"
|
||||||
|
end
|
||||||
|
|
||||||
if CONFIG.disabled?("downloads")
|
if CONFIG.disabled?("downloads")
|
||||||
return "<p id=\"download\">#{translate(locale, "Download is disabled")}</p>"
|
return "<p id=\"download\">#{translate(locale, "Download is disabled")}</p>"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue