From 5265c3ebbbe608aa0a732d3a027e7b6ce23afbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=9E=9C=E7=9A=9E?= Date: Mon, 1 May 2023 04:10:08 +0800 Subject: [PATCH] Not proper way to fix the encoding error. Gzip is not a standard option in Accept-Encoding, but removing 'br' can still fix the issue. However, to avoid using non-modern browsers without gzip support, it may be better to force users to install Brotli. This error occurred on my newly installed Python on Windows; there were no issues on my Linux machine. --- pinterest-downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinterest-downloader.py b/pinterest-downloader.py index 7673ec0..7b2765b 100755 --- a/pinterest-downloader.py +++ b/pinterest-downloader.py @@ -197,7 +197,7 @@ def get_session(ver_i, proxies, cookie_file): 'User-Agent': UA, 'Accept': 'application/json, text/javascript, */*, q=0.01', 'Accept-Language': 'en-US,en;q=0.5', - 'Accept-Encoding': 'gzip, deflate, utf-8', + 'Accept-Encoding': 'gzip, deflate, br', 'Referer': 'https://www.pinterest.com/', 'X-Requested-With': 'XMLHttpRequest', 'X-APP-VERSION': VER[ver_i],