Commit f0da96f46b

f0da96f46b741ddc3c6e765bac308dcd9a9960a7

parent: 4e99b84b38

Unsigned

Wraient <wraient.911@gmail.com> · 2026-04-05 21:25 UTC

Fix: Every allanime api call uses POST request now

Layout: unified · split

Build/curd-windows-build.iss +1 −1
@@ -1,6 +1,6 @@
1[Setup] 1[Setup]
2AppName=Curd Installer 2AppName=Curd Installer
3AppVersion=1.2.0 3AppVersion=1.2.1
4DefaultDirName={userappdata}\Curd 4DefaultDirName={userappdata}\Curd
5PrivilegesRequired=lowest 5PrivilegesRequired=lowest
6AllowNoIcons=yes 6AllowNoIcons=yes
internal/anime_list.go +11 −9
@@ -1,11 +1,11 @@
1package internal 1package internal
2 2
3import ( 3import (
4 "bytes"
4 "encoding/json" 5 "encoding/json"
5 "fmt" 6 "fmt"
6 "io" 7 "io"
7 "net/http" 8 "net/http"
8 "net/url"
9 "os" 9 "os"
10 "path/filepath" 10 "path/filepath"
11 "strings" 11 "strings"
@@ -137,24 +137,26 @@ func searchAnimeByMode(query, mode, preferredMode string) ([]SelectionOption, er
137 "countryOrigin": "ALL", 137 "countryOrigin": "ALL",
138 } 138 }
139 139
140 // Marshal the variables to JSON 140 // Build POST request body
141 variablesJSON, err := json.Marshal(variables) 141 requestBody, err := json.Marshal(map[string]interface{}{
142 "query": searchGql,
143 "variables": variables,
144 })
142 if err != nil { 145 if err != nil {
143 Log(fmt.Sprintf("Error encoding variables to JSON: %v", err)) 146 Log(fmt.Sprintf("Error encoding request body to JSON: %v", err))
144 return animeList, err 147 return animeList, err
145 } 148 }
146 149
147 // Build the request URL 150 // Make the HTTP POST request
148 url := fmt.Sprintf("%s?variables=%s&query=%s", allanimeAPI, url.QueryEscape(string(variablesJSON)), url.QueryEscape(searchGql)) 151 req, err := http.NewRequest("POST", allanimeAPI, bytes.NewBuffer(requestBody))
149
150 // Make the HTTP request
151 req, err := http.NewRequest("GET", url, nil)
152 if err != nil { 152 if err != nil {
153 Log(fmt.Sprintf("Error creating HTTP request: %v", err)) 153 Log(fmt.Sprintf("Error creating HTTP request: %v", err))
154 return animeList, err 154 return animeList, err
155 } 155 }
156 req.Header.Set("Content-Type", "application/json")
156 req.Header.Set("User-Agent", agent) 157 req.Header.Set("User-Agent", agent)
157 req.Header.Set("Referer", allanimeRef) 158 req.Header.Set("Referer", allanimeRef)
159 req.Header.Set("Origin", allanimeRef)
158 160
159 client := &http.Client{} 161 client := &http.Client{}
160 resp, err := client.Do(req) 162 resp, err := client.Do(req)