3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/overscribe/youtube_dl.rb', line 3
def self.download(url:, args:, options:)
command = %w[youtube-dl --add-metadata]
command += %w[--yes-playlist]
command += %w[--ignore-errors --no-call-home]
command += %w[--download-archive .youtube-dl.archive]
command += %w[--get-filename] if options['simulate'] == true
command += %W[--max-downloads #{options['limit']}] unless options['limit'].nil? || options['limit'].zero?
command += %W[--output #{options['filename_pattern']}] unless options['filename_pattern'].nil?
command += args
command += [url]
run command
end
|