fix: use /v1 endpoint for FlareSolverr API
FlareSolverr v3.x uses /v1 endpoint, not root /. The previous implementation was hitting the root endpoint which returned 405 Method Not Allowed.
This commit is contained in:
1 parent
3edc987281
commit
0abcead359
1 file changed
+3
-1
@@ -1,11 +1,13 @@
|
|||||||
const FLARESOLVERR_URL =
|
const FLARESOLVERR_URL =
|
||||||
process.env.FLARESOLVERR_URL ?? "http://localhost:8191";
|
process.env.FLARESOLVERR_URL ?? "http://localhost:8191";
|
||||||
|
|
||||||
|
const FLARESOLVERR_API = `${FLARESOLVERR_URL}/v1`;
|
||||||
|
|
||||||
export async function fetchWithFlareSolver(
|
export async function fetchWithFlareSolver(
|
||||||
url: string,
|
url: string,
|
||||||
timeout = 30000,
|
timeout = 30000,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const res = await fetch(FLARESOLVERR_URL, {
|
const res = await fetch(FLARESOLVERR_API, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|||||||
Reference in new issue
Block a user