Open 821wkli opened 11 months ago
Thank you @821wkli !
346
This is the migration of IOS app login
thank you, it is working again
Thank you, it works
it works, save my day. thank you!
Thanks
Is it still working for you? I'm getting some error when trying to login (https://github.com/821wkli/safaribooks/blob/login_fix/safaribooks.py#L477-L488)
[#] Unhandled Exception: Expecting value: line 1 column 1 (char 0) (type: JSONDecodeError)
If I add print(response.text)
just before trying to decode as JSON I can see the next body:
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://api.oreilly.com/api/v1/auth/login/" on this server.<P>
Reference #18.8b7a7b5c.1708962162.62e9acfa
</BODY>
</HTML>
not working anymore. refer #351 for manual walk around.
Is it still working for you? I'm getting some error when trying to login (https://github.com/821wkli/safaribooks/blob/login_fix/safaribooks.py#L477-L488)
[#] Unhandled Exception: Expecting value: line 1 column 1 (char 0) (type: JSONDecodeError)
If I add
print(response.text)
just before trying to decode as JSON I can see the next body:<HTML><HEAD> <TITLE>Access Denied</TITLE> </HEAD><BODY> <H1>Access Denied</H1> You don't have permission to access "http://api.oreilly.com/api/v1/auth/login/" on this server.<P> Reference #18.8b7a7b5c.1708962162.62e9acfa </BODY> </HTML>
not working anymore. refer #351 for manual walk around.
Is it still working for you? I'm getting some error when trying to login (https://github.com/821wkli/safaribooks/blob/login_fix/safaribooks.py#L477-L488)
[#] Unhandled Exception: Expecting value: line 1 column 1 (char 0) (type: JSONDecodeError)
If I add
print(response.text)
just before trying to decode as JSON I can see the next body:<HTML><HEAD> <TITLE>Access Denied</TITLE> </HEAD><BODY> <H1>Access Denied</H1> You don't have permission to access "http://api.oreilly.com/api/v1/auth/login/" on this server.<P> Reference #18.8b7a7b5c.1708962162.62e9acfa </BODY> </HTML>
Note: After setting the cookies.json
file manually, run python3 safaribooks.py bookID
without --cred "xx:xx"
What I find works for me is to
pip install browser_cookie3
add
import browser_cookie3
to safaribooks.py
and change
if not args.cred:
if not os.path.isfile(COOKIES_FILE):
self.display.exit("Login: unable to find `cookies.json` file.\n"
" Please use the `--cred` or `--login` options to perform the login.")
self.session.cookies.update(json.load(open(COOKIES_FILE)))
to
if not args.cred:
# if not os.path.isfile(COOKIES_FILE):
# self.display.exit("Login: unable to find `cookies.json` file.\n"
# " Please use the `--cred` or `--login` options to perform the login.")
# self.session.cookies.update(json.load(open(COOKIES_FILE)))
self.session.cookies.update(browser_cookie3.chrome())
Then, if I log in using Chome and run the script without providing credentials, it works.
thank you @teticio, worked for me.
346
This is the migration of IOS app login