Skip to content

Conversation

@IhavenoideawhatIamdoingIamadog
Copy link

@IhavenoideawhatIamdoingIamadog IhavenoideawhatIamdoingIamadog commented Jun 7, 2025

Khinsider requires headers or else it will return 403 errors with requests.get(). Also enforced request encoding as "raw" as requests were returning compressed garble.

Khinsider requires headers or else it will return 403 errors with requests.get()
"identity" means you get the "raw" request, whereas the server was returning a compressed request.
@IhavenoideawhatIamdoingIamadog IhavenoideawhatIamdoingIamadog changed the title Added headers Added headers + request encoding as raw Jun 12, 2025
Sec-Fetch-Site has to be added or else errors will be returned.
Cloudflare protection really does not like Windows users, flagging any requests from them as bot activity and returning 403 errors, regardless of what is used for the request header. To circumvent this, we need to install the cloudscraper package, which is mostly a drop-in replacement, though it doesn't have ConnectionError like requests have, so clauses checking the connection may not work/throw up appropriate errors going forward.

Depending on whether Linux/Mac users similarly are treated as bot activity, this Windows version may merge with the OG khinsider in future.
Copy link

@Le09 Le09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #101
(minus the more stricts check that CloudFlare protection might be doing -- but it should be a separate issue)

@anthonymag
Copy link

Thanks for this updated script, it's working great for me!
I'm not the maintainer but I'd strongly guess they don't want two versions of the same script with minor diffs and will likely instead prefer you have conditionals in the existing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants