-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix cloudflare 403 with curl_cffi #205
base: master
Are you sure you want to change the base?
Conversation
Can confirm that this works as expected. Before this I had problem with authenticating. |
Works as expected - Was not able to authenticate before |
I tried to run this fix, but it throws an error - see below.
|
The published |
I have tried this patch and it is not working for me. I tried Saturday and then again this morning thinking maybe my IP was still blocked. Mac OS 15.1.1 python 3.13 There are no errors other than the "403 Client Error: Forbidden for url: https://ocapi-app.arlo.com/api/auth" |
Sorry - it does work. I somehow had screwed up my venv and it was using system packages instead of the virtual environment. Thanks for working out a fix for this! |
Cloudflare frequently returns a 403 on the Arlo login, which to the best of my understanding is decided on client heuristics, i.e. if a client is determined with some confidence to not be a browser, the request is blocked. One of the heuristics used is the TLS fingerprint of the client. The
curl_cffi
project aims to enable Python scripts to bypass this TLS fingerprinting check through creating TLS handshakes that are identical to a real Chrome browser. This is accomplished through the use of thecurl-impersonate
project, which compilescurl
with the exact TLS/SSL libraries used by Chrome and Firefox.We have seen reasonable success in using this option over
cloudscraper
in the Scrypted home automation project. A caveat is thatcurl_cffi
exposes arequests
-like API, but does not implement the full API; therefore,curl_cffi
is only used for the initial login, and subsequent requests fall back onrequests
sosseclient
can continue working. Arlo appears to be happy with just the token in the header, and performs no additional TLS fingerprinting checks after login succeeds.Note that this is not tested comprehensively, since I do not use this version of the arlo library.
Fixes #204