From ec48e47e3391d28d9761d1b90baddd0e4d988321 Mon Sep 17 00:00:00 2001 From: maforget <11904426+maforget@users.noreply.github.com> Date: Sat, 25 May 2024 00:59:50 -0400 Subject: [PATCH] Removed linux from random user agent Because it would prevent from getting data (possibily). Updated range of versions --- AmazonScrapper/Web/Fetcher.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/AmazonScrapper/Web/Fetcher.cs b/AmazonScrapper/Web/Fetcher.cs index 6fbc315..b770c05 100644 --- a/AmazonScrapper/Web/Fetcher.cs +++ b/AmazonScrapper/Web/Fetcher.cs @@ -208,13 +208,13 @@ private string GetRandomUserAgent() var browserType = new string[] { "chrome", "edge", "firefox" }; lock (syncLock) { - int version = rand.Next(103, 110); + int version = rand.Next(103, 126); string finalVersion = version.ToString(); - int patch = rand.Next(1264, 1660); + int patch = rand.Next(1264, 2535); int build = rand.Next(10, 80); string randomBroswer = browserType[rand.Next(browserType.Length)]; - var OS = new string[] { "Windows NT 10.0; Win64; x64", "X11; Linux x86_64", "Macintosh; Intel Mac OS X 13_2_1" }; + var OS = new string[] { "Windows NT 10.0; Win64; x64", "Macintosh; Intel Mac OS X 13_2_1" }; string OSsystem = OS[rand.Next(OS.Length)]; var UATemplate = new Dictionary @@ -225,6 +225,8 @@ private string GetRandomUserAgent() }; userAgent = UATemplate[randomBroswer]; } + + SimpleLogger.Info(userAgent); } return userAgent;