libreX fix
This commit is contained in:
parent
abce95724a
commit
dd9ed4cc53
1 changed files with 5 additions and 1 deletions
|
@ -19,7 +19,11 @@ type LibreXResult struct {
|
||||||
type LibreXResponse []LibreXResult
|
type LibreXResponse []LibreXResult
|
||||||
|
|
||||||
func PerformLibreXTextSearch(query, safe, lang string, page int) ([]TextSearchResult, error) {
|
func PerformLibreXTextSearch(query, safe, lang string, page int) ([]TextSearchResult, error) {
|
||||||
// LibreX uses page starting from 0
|
|
||||||
|
// LibreX/Y uses offset instead of page that starts at 0
|
||||||
|
page--
|
||||||
|
page = page * 10
|
||||||
|
|
||||||
searchURL := fmt.Sprintf("https://%s/api.php?q=%s&p=%d&t=0", LIBREX_DOMAIN, url.QueryEscape(query), page)
|
searchURL := fmt.Sprintf("https://%s/api.php?q=%s&p=%d&t=0", LIBREX_DOMAIN, url.QueryEscape(query), page)
|
||||||
|
|
||||||
// User Agent generation
|
// User Agent generation
|
||||||
|
|
Loading…
Add table
Reference in a new issue