Random User Agent generator

This commit is contained in:
Pablo Ferreiro 2023-03-05 13:18:34 +01:00
parent ecba96eaf4
commit eeaa8cdf1c
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
2 changed files with 71 additions and 25 deletions

View file

@ -164,7 +164,11 @@ class Wrappers {
}
}
$options["user_agent"] = Misc::env("USER_AGENT", TikScraperUserAgents::DEFAULT);
$customUa = Misc::env("USER_AGENT", '');
if ($customUa) {
$options['user_agent'] = $customUa;
}
return new \TikScraper\Api($options, $cacheEngine);
}