From 1c9f5b0a2b38ad94fb8972764ffae98df1e41dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milien=20=28perso=29?= <4016501+unixfox@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:31:21 +0100 Subject: [PATCH] Use sample instead of Random.rand Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> --- src/invidious/yt_backend/youtube_api.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index b0494203..1bd236d2 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -648,7 +648,7 @@ module YoutubeAPI puts "invidious companion section" puts invidious_companion_urls[Random.rand(invidious_companion_urls.size)] begin - invidious_companion_response = make_client(URI.parse(invidious_companion_urls[Random.rand(invidious_companion_urls.size)]), + invidious_companion_response = make_client(URI.parse(invidious_companion_urls.sample), &.post(endpoint, headers: headers, body: data.to_json)) body = invidious_companion_response.body if (invidious_companion_response.status_code != 200)