fix for pages
This commit is contained in:
parent
6885983576
commit
a86b370f69
5 changed files with 99 additions and 157 deletions
|
@ -20,7 +20,7 @@ type LibreXResponse []LibreXResult
|
|||
|
||||
func PerformLibreXTextSearch(query, safe, lang string, page int) ([]TextSearchResult, error) {
|
||||
// LibreX uses page starting from 0
|
||||
searchURL := fmt.Sprintf("https://%s/api.php?q=%s&p=%d&t=0", LIBREX_DOMAIN, url.QueryEscape(query), page-1)
|
||||
searchURL := fmt.Sprintf("https://%s/api.php?q=%s&p=%d&t=0", LIBREX_DOMAIN, url.QueryEscape(query), page)
|
||||
|
||||
// User Agent generation
|
||||
userAgent, err := GetUserAgent("librex-text-search")
|
||||
|
@ -63,10 +63,6 @@ func PerformLibreXTextSearch(query, safe, lang string, page int) ([]TextSearchRe
|
|||
Source: "LibreX",
|
||||
}
|
||||
|
||||
if debugMode {
|
||||
log.Printf("LibreX result: %+v\n", result)
|
||||
}
|
||||
|
||||
results = append(results, result)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue