This commit is contained in:
parent
614ce8903e
commit
8db4e18ee4
2 changed files with 10 additions and 6 deletions
|
@ -76,7 +76,7 @@ func buildSearchURL(query, safe, lang string, page, resultsPerPage int) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
langParam := ""
|
langParam := ""
|
||||||
var glParam string
|
glParam := ""
|
||||||
|
|
||||||
if lang != "" {
|
if lang != "" {
|
||||||
// Use lang as the geolocation
|
// Use lang as the geolocation
|
||||||
|
@ -88,12 +88,16 @@ func buildSearchURL(query, safe, lang string, page, resultsPerPage int) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
startIndex := (page - 1) * resultsPerPage
|
startIndex := (page - 1) * resultsPerPage
|
||||||
|
udmParam := "&udm=14" // Add the required parameter
|
||||||
|
|
||||||
printDebug(fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s&start=%d",
|
// Build the URL string
|
||||||
url.QueryEscape(query), safeParam, langParam, glParam, startIndex))
|
baseURL := "https://www.google.com/search?q=%s%s%s%s&start=%d%s"
|
||||||
|
fullURL := fmt.Sprintf(baseURL, url.QueryEscape(query), safeParam, langParam, glParam, startIndex, udmParam)
|
||||||
|
|
||||||
return fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s&start=%d",
|
// Debug print
|
||||||
url.QueryEscape(query), safeParam, langParam, glParam, startIndex)
|
printDebug("%s", fullURL)
|
||||||
|
|
||||||
|
return fullURL
|
||||||
}
|
}
|
||||||
|
|
||||||
// func getRandomGeoLocation() (string, string) {
|
// func getRandomGeoLocation() (string, string) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ func PerformLibreXTextSearch(query, safe, lang string, page int) ([]TextSearchRe
|
||||||
|
|
||||||
// Perform the request using the appropriate client
|
// Perform the request using the appropriate client
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
if config.MetaProxyEnabled && metaProxyClient != nil {
|
if config.MetaProxyEnabled && config.MetaProxyStrict && metaProxyClient != nil {
|
||||||
resp, err = metaProxyClient.Do(req)
|
resp, err = metaProxyClient.Do(req)
|
||||||
} else {
|
} else {
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue