refactor: use url.Values in allanime graphql request

This commit is contained in:
2026-06-11 12:29:23 +02:00
parent 5ada1f72e4
commit 02bbc6c4d4

View File

@@ -324,10 +324,10 @@ func (c *AllAnimeProvider) graphqlRequestWithHash(ctx context.Context, showID, e
varsJSON := fmt.Sprintf(`{"showId":"%s","translationType":"%s","episodeString":"%s"}`, showID, mode, episode)
extJSON := fmt.Sprintf(`{"persistedQuery":{"version":1,"sha256Hash":"%s"}}`, episodeQueryHash)
apiURL := fmt.Sprintf("%s/api?variables=%s&extensions=%s",
allAnimeBaseURL,
url.QueryEscape(varsJSON),
url.QueryEscape(extJSON))
params := url.Values{}
params.Set("variables", varsJSON)
params.Set("extensions", extJSON)
apiURL := fmt.Sprintf("%s/api?%s", allAnimeBaseURL, params.Encode())
req, err := http.NewRequestWithContext(ctx, http.MethodGet, apiURL, nil)
if err != nil {