From 5c6c30b95f4ac7cbdf89e21f2323201a6b917f4a Mon Sep 17 00:00:00 2001 From: Alfredo Casanova Date: Wed, 31 May 2023 10:42:21 -0300 Subject: [PATCH] change encoding based on content This helps users trying to read content with other encodings. --- portable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/portable.py b/portable.py index 8c24a09..cfa07f8 100644 --- a/portable.py +++ b/portable.py @@ -93,6 +93,7 @@ def bypass_paywall(url): Bypass paywall for a given url """ response = requests.get(url, headers=googlebot_headers) + response.encoding = response.apparent_encoding return response.text