new: feat: add page indexing queryparam (#24)

This commit is contained in:
2024-12-11 16:04:48 -03:00
committed by GitHub
parent a6c3d3eed1
commit 0a702d1893
4 changed files with 16 additions and 4 deletions

View File

@@ -49,14 +49,17 @@ func (i *Indexer) HandlerComandoIndexer(w http.ResponseWriter, r *http.Request)
}()
ctx := r.Context()
// supported query params: q, season, episode
// supported query params: q, season, episode, page, filter_results
q := r.URL.Query().Get("q")
page := r.URL.Query().Get("page")
// URL encode query param
q = url.QueryEscape(q)
url := comando.URL
if q != "" {
url = fmt.Sprintf("%s%s%s", url, comando.SearchURL, q)
} else if page != "" {
url = fmt.Sprintf("%spage/%s", url, page)
}
fmt.Println("URL:>", url)