From 91143c6f1ea03dd3d27db9e9595899346f938f47 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 5 Jan 2023 20:50:17 +0100 Subject: [PATCH] Fix encoding --- pynyaata/flarerequests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pynyaata/flarerequests.py b/pynyaata/flarerequests.py index a94a7a8..9ee5e6a 100644 --- a/pynyaata/flarerequests.py +++ b/pynyaata/flarerequests.py @@ -29,6 +29,7 @@ class FlareRequests(Session): solution = response.json() if "solution" in solution: + encoding = None headers = solution["solution"]["headers"] if "content-type" in headers: content_type = headers["content-type"].split(";") @@ -43,7 +44,7 @@ class FlareRequests(Session): resolved.headers = headers resolved.raw = BytesIO(solution["solution"]["response"].encode()) resolved.url = url - resolved.encoding = encoding or None + resolved.encoding = encoding resolved.reason = solution["status"] resolved.cookies = solution["solution"]["cookies"]