Skip to content

Commit

Permalink
Removed linux from random user agent
Browse files Browse the repository at this point in the history
Because it would prevent from getting data (possibily).
Updated range of versions
  • Loading branch information
maforget committed May 25, 2024
1 parent c9e1fe0 commit ec48e47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions AmazonScrapper/Web/Fetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>
Expand All @@ -225,6 +225,8 @@ private string GetRandomUserAgent()
};
userAgent = UATemplate[randomBroswer];
}

SimpleLogger.Info(userAgent);
}

return userAgent;
Expand Down

0 comments on commit ec48e47

Please sign in to comment.