lib/jetel/downloader/backends/aria.rb in jetel-0.0.7 vs lib/jetel/downloader/backends/aria.rb in jetel-0.0.8

- old
+ new

@@ -12,10 +12,12 @@ $stdout.sync = true opts = BaseDownloader::OPTS_DOWNLOAD.merge(opts) - cmd = "aria2c -j 4 -t #{opts[:timeout]} -d \"#{opts[:dir]}\" #{url}" + filename = opts[:filename] || url.split('/').last + + cmd = "aria2c -j 4 -t #{opts[:timeout]} -d \"#{opts[:dir]}\" -o \"#{filename}\" #{url}" puts(cmd) PTY.spawn(cmd) do |stdout, stdin, pid| begin # Do stuff with the output here. Just printing to show it works