libpurecool icon indicating copy to clipboard operation
libpurecool copied to clipboard

Unable to login

Open ThibautLandrein opened this issue 2 years ago • 3 comments

Hello, I have forked the repo and have been trying to log in. However i get an error from cloudflare stating that i've been blocked. Are the credentials the same to log in within the Dyson app ? Has anyone encountered this issue ? I have tried to change the User-Agent header to "Mozilla/5.0" but it didn't work

image

ThibautLandrein avatar Dec 15 '23 12:12 ThibautLandrein

Are you able to authenticate via the app on the same network (assuming you use NAT) address that you are getting the blocked message for? The issue is that Dyson are ... unfriendly.. to people who want to try and incorporate their product into home automation systems.

I don't think cp.dyson.com is actually a valid domain for web traffic?

+ dig ANY cp.dyson.com

; <<>> DiG 9.10.6 <<>> ANY cp.dyson.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48479
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;cp.dyson.com.                  IN      ANY

;; ANSWER SECTION:
cp.dyson.com.           169     IN      MX      10 feedback-smtp.eu-central-1.amazonses.com.
cp.dyson.com.           1759    IN      SOA     andronicus.ns.cloudflare.com. dns.cloudflare.com. 2324820319 10000 2400 604800 1800
cp.dyson.com.           169     IN      MX      10 feedback-smtp.eu-west-1.amazonses.com.

;; Query time: 13 msec
;; SERVER: 2404:79c0:1002:1000:59c5:6de9:33a6:ec24#53(2404:79c0:1002:1000:59c5:6de9:33a6:ec24)
;; WHEN: Fri Dec 15 23:42:57 AEDT 2023
;; MSG SIZE  rcvd: 199

+ dig A cp.dyson.com

; <<>> DiG 9.10.6 <<>> A cp.dyson.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64282
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;cp.dyson.com.                  IN      A

;; Query time: 3 msec
;; SERVER: 2404:79c0:1002:1000:59c5:6de9:33a6:ec24#53(2404:79c0:1002:1000:59c5:6de9:33a6:ec24)
;; WHEN: Fri Dec 15 23:42:57 AEDT 2023
;; MSG SIZE  rcvd: 41

+ dig AAAA cp.dyson.com

; <<>> DiG 9.10.6 <<>> AAAA cp.dyson.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45503
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;cp.dyson.com.                  IN      AAAA

;; Query time: 2 msec
;; SERVER: 2404:79c0:1002:1000:59c5:6de9:33a6:ec24#53(2404:79c0:1002:1000:59c5:6de9:33a6:ec24)
;; WHEN: Fri Dec 15 23:42:57 AEDT 2023
;; MSG SIZE  rcvd: 41

troykelly avatar Dec 15 '23 12:12 troykelly

Hi Troy, thanks for answering. Indeed they do not seem to make it easy accessing this API... Credentials i used work fine on the app and website. As of now this is my code :

from libpurecool.dyson import DysonAccount
acc = DysonAccount("[email protected]", "XXXXXX, "FR")
acc.login()

And the screenshot i attached to the issue is the html page I get from the post request on the /userregistration/authenticate endpoint

ThibautLandrein avatar Dec 15 '23 15:12 ThibautLandrein

I also tried using the code from https://github.com/etheralm/libpurecool/pull/39 but the problem stays the same

ThibautLandrein avatar Dec 15 '23 15:12 ThibautLandrein

With this Project you can easily connect to your Dyson fan https://github.com/Kill0geR/DysonPythonHack

Kill0geR avatar Aug 20 '24 21:08 Kill0geR

Thanks @Kill0geR i'm going to check this out

ThibautLandrein avatar Aug 21 '24 08:08 ThibautLandrein