Fix CLI options

pull/3/head
Omar Roth 7 years ago
parent 3cd66d2e7c
commit be6ced202c

@ -26,7 +26,7 @@ yt_wait = 1.0
Kemal.config.extra_options do |parser| Kemal.config.extra_options do |parser|
parser.banner = "Usage: invidious [arguments]" parser.banner = "Usage: invidious [arguments]"
parser.on("-yp SIZE", "--youtube-pool=SIZE", "Number of clients in youtube pool (default: #{yt_pool_size})") do |number| parser.on("-p SIZE", "--youtube-pool=SIZE", "Number of clients in youtube pool (default: #{yt_pool_size})") do |number|
begin begin
yt_pool_size = number.to_i yt_pool_size = number.to_i
rescue ex rescue ex
@ -34,7 +34,7 @@ Kemal.config.extra_options do |parser|
exit exit
end end
end end
parser.on("-yt THREADS", "--youtube-threads=THREADS", "Number of threads for crawling (default: #{yt_threads})") do |number| parser.on("-t THREADS", "--youtube-threads=THREADS", "Number of threads for crawling (default: #{yt_threads})") do |number|
begin begin
yt_threads = number.to_i yt_threads = number.to_i
rescue ex rescue ex
@ -42,7 +42,7 @@ Kemal.config.extra_options do |parser|
exit exit
end end
end end
parser.on("-yw SECONDS", "--youtube-wait=SECONDS", "Time to wait between youtube server requests (default: #{yt_wait})") do |number| parser.on("-w SECONDS", "--youtube-wait=SECONDS", "Time to wait between youtube server requests (default: #{yt_wait})") do |number|
begin begin
yt_wait = number.to_f64 yt_wait = number.to_f64
rescue ex rescue ex
@ -64,7 +64,7 @@ CONTEXT.add_options(
OpenSSL::SSL::Options::NO_SSL_V2 | OpenSSL::SSL::Options::NO_SSL_V2 |
OpenSSL::SSL::Options::NO_SSL_V3 OpenSSL::SSL::Options::NO_SSL_V3
) )
youtube_pool = Deque.new(yt_pool_size.to_i) do youtube_pool = Deque.new(yt_pool_size) do
make_client(YT_URL, CONTEXT) make_client(YT_URL, CONTEXT)
end end

Loading…
Cancel
Save