Closed thesurlydev closed 1 year ago
Hi @digitalsanctum, you can now use browser cookies for authentication. Please update and give it a try
Still running into an issue:
orly --cookie 'BrowserCookie=AWSALB=...; AWSALBCORS=...' 9780136915805
[2021-11-09 07:54:29][INFO] Logging into Safari Books Online usig cookies...
[2021-11-09 07:54:29][INFO] Validating subscription
[2021-11-09 07:54:29][ERROR] Request failed: HTTP status client error (401 Unauthorized) for url (https://learning.oreilly.com/api/v1/payments/next_billing_date/)
Perhaps the subscription check can be skipped for cookie auth?
I think subscription check is required. You'll be able to download books successfully without it but the chapter content will be trimmed. I've tried cookie auth with both google and username/password authenticated account. Works fine for me. Make sure you copied the right (entire) cookie.
After signing in do the following (if you use Chrome):
https://learning.oreilly.com/api/v1/track/
cookie
header value from Request Headers
If you're using Firefox the cookie value might be trimmed. You can copy the request as curl and then copy the cookie value.
I don't think the billing endpoint is allowed in my case. See the following:
HTTP 403 Forbidden
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"detail": "You are not permitted to view this subscription."
}
I also don't see the /api/v1/track
showing up in any of the requests.
Hello @digitalsanctum,
Sorry for the late response, didn’t have much time. Does disabling the subscription check solve the issue? Is everything else working fine? #2
I'd like to add support for SSO but I don't have an account to test it with. One reason I don’t want to remove subscription validation completely is because with expired subscription the app would still download the book successfully but the book itself will be truncated - only a couple paragraphs from each chapter will be visible.
I have an O'Reilly account via acm.org which seems to use a different auth mechanism (SSO). Please consider adding support for SSO.