class YtDownloader::CLI::Commands::Download

Public Instance Methods

call(**options) click to toggle source
# File lib/yt_downloader.rb, line 38
def call(**options)
  # make sure dir structure exists
  Pathname(options.fetch(:destination)).dirname.mkpath
  Pathname(options.fetch(:logger_path)).dirname.mkpath

  bookmark_tabs = options.fetch(:bookmark_tabs).split(',')
  downloader = Downloader.new(Downloader::YTDL, destination: options.fetch(:destination), audio_format: options.fetch(:audio_format))

  Converter.call(downloader: downloader,
                 parser: Parser.new(options.fetch(:parser)),
                 source: options.fetch(:source, nil),
                 bookmark_tabs: bookmark_tabs,
                 logger: Logger.new(options.fetch(:logger_path)))
end