lorenzodifuccia / safaribooks

Download and generate EPUB of your favorite books from O'Reilly Learning (aka Safari Books Online) library.
Do What The F*ck You Want To Public License
4.65k stars 691 forks source link

Login: unable to perform auth login to Safari Books Online. Unexpected error! #217

Closed danyflorez closed 1 year ago

danyflorez commented 4 years ago

Hi, I'm getting this error trying to download a book:

   ____     ___         _     
  / __/__ _/ _/__ _____(_)    
 _\ \/ _ `/ _/ _ `/ __/ /     
/___/\_,_/_/ \_,_/_/ /_/      
  / _ )___  ___  / /__ ___    
 / _  / _ \/ _ \/  '_/(_-<    
/____/\___/\___/_/\_\/___/    

[-] Logging into Safari Books Online...                                         
[#] Login: unable to perform auth login to Safari Books Online.                 
[*] Details:
    Unexpected error!
[!] Aborting..

Do you know how I can solve it? Thanks
obar1 commented 4 years ago

have you tried to use the new script to create user it worked for me

https://github.com/lorenzodifuccia/safaribooks/blob/master/register_user.py

Eddy300 commented 4 years ago

I also have same error can some pls fix this ... using new version .

philnewman commented 4 years ago

I had the same error when using the --cred argument. I removed it and changed to the --login and its working for me.

Nockternal commented 4 years ago

Hi Guys im also having this problem now. the account is an auth account from office 365. however this was working with --cred. since i was forced to do a password update neither --cred or --login works. yet when i copy and paste user and pass to login i have no problem.

error:


[-] Logging into Safari Books Online... [#] Login: unable to perform auth login to Safari Books Online. [*] Details: Unexpected error! [!] Aborting...


log: removed username and password for security


[18/Oct/2020 14:27:35] Welcome to SafariBooks! [18/Oct/2020 14:27:35] Logging into Safari Books Online... [18/Oct/2020 14:27:39] Login: unable to perform auth login to Safari Books Online. [*] Details: Unexpected error! [18/Oct/2020 14:27:39] Last request done: URL: https://www.oreilly.com/member/auth/login/ DATA: None OTHERS: {'json': {'email': 'xxxxxxxxxxxxxxxxxxxx', 'password': 'xxxxxxxxxxxxxxxxxxxx', 'redirect_uri': 'https://api.oreilly.com%2Fapi%2Fv1%2Fauth%2Fopenid%2Fauthorize%2F%3Fclient_id%3D235442%26redirect_uri%3Dhttps%3A%2F%2Flearning.oreilly.com%2Fcomplete%2Funified%2F%26state%3D5eDiMcXfNm1hCvQMjUDHu7dX35rL82na%26response_type%3Dcode%26scope%3Dopenid%2Bprofile%2Bemail'}}

400
Server: istio-envoy
Vary: Accept, Cookie, Origin,Accept, Accept-Encoding, Authorization, Cookie,Accept, Accept-Encoding, Authorization, Cookie
Content-Type: application/json
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains
surrogate-key: groot groot-api, groot_frontend_ds groot_frontend_ds-pages
x-envoy-upstream-service-time: 50
x-content-type-options: nosniff, nosniff, nosniff
Allow: POST, OPTIONS
x-frame-options: DENY
Content-Length: 37
Expires: Sun, 18 Oct 2020 12:27:42 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Sun, 18 Oct 2020 12:27:42 GMT
Connection: close

{"credentials":"invalid_credentials"}


further more when i try register my user i get the below error:

Error 0x2: CSRF token not present


seems to be a problem with 2 factor authenticated account like office.com

nestornav commented 3 years ago

Hi, I have the same issue that all you here.

[-] Logging into Safari Books Online...                                         
[#] Login: unable to perform auth login to Safari Books Online.                 
[*] Details:
    Unexpected error!
[!] Aborting..

Do you know how I can solve it? Thanks

In other hand, I checked the request.status_code and it's an error 400. Seems like the api changed.