module Invidious::Frontend::WatchPage extend self # A handy structure to pass many elements at # once to the download widget function struct VideoAssets getter full_videos : Array(Hash(String, JSON::Any)) getter video_streams : Array(Hash(String, JSON::Any)) getter audio_streams : Array(Hash(String, JSON::Any)) getter captions : Array(Caption) def initialize( @full_videos, @video_streams, @audio_streams, @captions ) end end def download_widget(locale : String, video : Video, video_assets : VideoAssets) : String if CONFIG.disabled?("downloads") return "
#{translate(locale, "Download is disabled.")}
" end return String.build(4000) do |str| str << "\n" end end end