File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ require 'shellwords'
2+
13module ViddlRb
24
35 class RequirementError < StandardError ; end
@@ -23,14 +25,20 @@ def get_command(download_url, save_path)
2325 TOOLS_PRIORITY_LIST = [
2426
2527 Tool . new ( :aria2c ) do |url , path |
28+ url = Shellwords . escape ( url )
29+ path = Shellwords . escape ( url )
2630 "aria2c #{ url . inspect } -U 'Wget/1.8.1' -x4 -d #{ File . dirname ( path ) . inspect } -o #{ File . basename ( path ) . inspect } "
2731 end ,
2832
2933 Tool . new ( :wget ) do |url , path |
34+ url = Shellwords . escape ( url )
35+ path = Shellwords . escape ( url )
3036 "wget -c #{ url . inspect } -O #{ path . inspect } "
3137 end ,
3238
3339 Tool . new ( :curl ) do |url , path |
40+ url = Shellwords . escape ( url )
41+ path = Shellwords . escape ( url )
3442 "curl -A 'Wget/1.8.1' --retry 10 --retry-delay 5 --retry-max-time 4 -L #{ url . inspect } -o #{ path . inspect } "
3543 end
3644 ]
You can’t perform that action at this time.
0 commit comments