mirror of
https://github.com/edoardottt/cariddi.git
synced 2026-09-06 01:37:45 +02:00
Fix user agent
This commit is contained in:
@@ -312,10 +312,6 @@ func CreateColly(delayTime int, concurrency int, cache bool, timeout int,
|
||||
c.IgnoreRobotsTxt = true
|
||||
c.AllowURLRevisit = false
|
||||
|
||||
if userAgent != "" {
|
||||
c.UserAgent = userAgent
|
||||
}
|
||||
|
||||
err := c.Limit(
|
||||
&colly.LimitRule{
|
||||
Parallelism: concurrency,
|
||||
@@ -345,6 +341,10 @@ func CreateColly(delayTime int, concurrency int, cache bool, timeout int,
|
||||
c.UserAgent = GenerateRandomUserAgent()
|
||||
}
|
||||
|
||||
if userAgent != "" {
|
||||
c.UserAgent = userAgent
|
||||
}
|
||||
|
||||
// Use a Proxy if needed
|
||||
if proxy != "" {
|
||||
err := c.SetProxy(proxy)
|
||||
|
||||
Reference in New Issue
Block a user