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.
This commit is contained in:
林果皞
2023-05-01 04:10:08 +08:00
committed by GitHub
parent 7d08831af1
commit 5265c3ebbb

View File

@@ -197,7 +197,7 @@ def get_session(ver_i, proxies, cookie_file):
'User-Agent': UA, 'User-Agent': UA,
'Accept': 'application/json, text/javascript, */*, q=0.01', 'Accept': 'application/json, text/javascript, */*, q=0.01',
'Accept-Language': 'en-US,en;q=0.5', 'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, utf-8', 'Accept-Encoding': 'gzip, deflate, br',
'Referer': 'https://www.pinterest.com/', 'Referer': 'https://www.pinterest.com/',
'X-Requested-With': 'XMLHttpRequest', 'X-Requested-With': 'XMLHttpRequest',
'X-APP-VERSION': VER[ver_i], 'X-APP-VERSION': VER[ver_i],