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(Invidious::Videos::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 << "" str << '\n' # Hidden inputs for video id and title str << "\n" str << "\n" str << "\t
\n" str << "\t\t\n" # TODO: remove inline style str << "\t\t\n" str << "\t
\n" str << "\t\n" str << "\n" end end end