refactor: use url.Values in allanime graphql request
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user