From 954b019ef270102f86bd320323de2d4254ccc56f Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 5 Jan 2023 21:05:41 +0100 Subject: [PATCH] Fix encoding --- commands/pygg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/pygg.py b/commands/pygg.py index 4133899..f64a5ae 100755 --- a/commands/pygg.py +++ b/commands/pygg.py @@ -39,6 +39,7 @@ class FlareRequests(requests.Session): content = response.json() if "solution" in content: + encoding = None solution = content["solution"] if "content-type" in solution["headers"]: content_type = solution["headers"]["content-type"].split(";") @@ -53,7 +54,7 @@ class FlareRequests(requests.Session): resolved.headers = solution["headers"] resolved.raw = io.BytesIO(solution["response"].encode()) resolved.url = url - resolved.encoding = encoding or None + resolved.encoding = encoding resolved.reason = content["status"] resolved.cookies = solution["cookies"]