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.62k stars 685 forks source link

Incomplete pages truncated SSO (download) #284

Closed alvamich closed 3 years ago

alvamich commented 3 years ago

I am having the issue with this python3 safaribooks.py 9781787780422 Using SSO. no error display but page are trunketed finishing with ...

[-] Successfully authenticated.
[*] Retrieving book info...
[-] Title: NIST Cybersecurity Framework - A pocket guide

[-] URL: https://learning.oreilly.com/library/view/nist-cybersecurity-framework/9781787780422/
[] Retrieving book chapters...
[
] Output directory:
safaribooks/Books/NIST Cybersecurity Framework - A pocket guide (9781787780422) [-] Downloading book contents... (16 chapters)
[##########################################################################################################################################################] 100% [-] Downloading book CSSs... (2 files)
[##########################################################################################################################################################] 100% [-] Downloading book images... (7 files)
[##########################################################################################################################################################] 100% [-] Creating EPUB file...
[*] Done: Books/NIST Cybersecurity Framework - A pocket guide (9781787780422)/9781787780422.epub

If you like it, please * this project on GitHub to make it known:
    https://github.com/lorenzodifuccia/safaribooks
e don't forget to renew your Safari Books Online subscription:
    https://learning.oreilly.com

[!] Bye!!

alvamich commented 3 years ago

solved is an issue with SSO. I just replaced line 31 for the py file. based on issue 184https://github.com/lorenzodifuccia/safaribooks/issues/184

It seems like for the "web_url" it doesn't "authorize", but for the content it does, it's different URLs. And I also had to replace in 31 line PROFILE_URL = SAFARI_BASE_URL + "/profile/" with PROFILE_URL = "https://learning.oreilly.com/home/?next=%2Fprofile%2F" or PROFILE_URL = "https://learning.oreilly.com/home/" to avoid the "Authentication issue: unable to access profile page" error.