fix: remove random location when lang is set
This commit is contained in:
parent
82d5a83911
commit
61af6fc453
1 changed files with 10 additions and 5 deletions
|
@ -66,12 +66,17 @@ func buildSearchURL(query, safe, lang string, page, resultsPerPage int) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
langParam := ""
|
langParam := ""
|
||||||
if lang != "" {
|
var glParam, uuleParam string
|
||||||
langParam = "&lr=lang_" + lang
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate random geolocation
|
if lang != "" {
|
||||||
glParam, uuleParam := getRandomGeoLocation()
|
// Use lang as the geolocation
|
||||||
|
langParam = "&lr=lang_" + lang
|
||||||
|
glParam = "&gl=" + lang
|
||||||
|
uuleParam = ""
|
||||||
|
} else {
|
||||||
|
// Use random geolocation
|
||||||
|
glParam, uuleParam = getRandomGeoLocation()
|
||||||
|
}
|
||||||
|
|
||||||
startIndex := (page - 1) * resultsPerPage
|
startIndex := (page - 1) * resultsPerPage
|
||||||
return fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s%s&start=%d",
|
return fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s%s&start=%d",
|
||||||
|
|
Loading…
Add table
Reference in a new issue