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) varsJSON := fmt.Sprintf(`{"showId":"%s","translationType":"%s","episodeString":"%s"}`, showID, mode, episode)
extJSON := fmt.Sprintf(`{"persistedQuery":{"version":1,"sha256Hash":"%s"}}`, episodeQueryHash) extJSON := fmt.Sprintf(`{"persistedQuery":{"version":1,"sha256Hash":"%s"}}`, episodeQueryHash)
apiURL := fmt.Sprintf("%s/api?variables=%s&extensions=%s", params := url.Values{}
allAnimeBaseURL, params.Set("variables", varsJSON)
url.QueryEscape(varsJSON), params.Set("extensions", extJSON)
url.QueryEscape(extJSON)) apiURL := fmt.Sprintf("%s/api?%s", allAnimeBaseURL, params.Encode())
req, err := http.NewRequestWithContext(ctx, http.MethodGet, apiURL, nil) req, err := http.NewRequestWithContext(ctx, http.MethodGet, apiURL, nil)
if err != nil { if err != nil {