Invidious is an alternative front-end to YouTube
Randomly refresh HTTP clients
Omar Rothf77dcb7f9ba9
diff --git a/src/invidious.cr b/src/invidious.crindex a0a6a4f7..8ba75cc2 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -21,9 +21,12 @@ end# Refresh all the connections in the pool by crawling recommendedspawn do# Arbitrary start value- id = Deque.new(50,"0xjKNDMgE54")+ id = Deque.new(50, "0xjKNDMgE54")while trueclient = get_client+ if rand(30) > 1+ client = HTTP::Client.new(URL, CONTEXT)+ endtime = Time.nowbegin@@ -33,7 +36,7 @@ spawn dorvs << HTTP::Params.parse(rv).to_hendrvs.each do |rv|- id << rv["id"]+ id << rv["id"]endputs "#{Time.now} 200 GET #{elapsed_text(Time.now - time)}"rescue ex