Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oReilly Username/Password authentication not working #8

Open
FlexMcMurphy opened this issue Sep 3, 2023 · 3 comments
Open

oReilly Username/Password authentication not working #8

FlexMcMurphy opened this issue Sep 3, 2023 · 3 comments

Comments

@FlexMcMurphy
Copy link

Hello,

I have installed docker in Manjaro linux and I am using a command like:
(docker run kirinnee/orly:latest login 9781788298025 email@domain.com:12345) > "MyBook.epub"

I realise you mention in the ReadMe that:
Note that it will take a long time to download. Output is only buffered every 4k bytes (so you might not see any console output for awhile)

But what does this mean exactly? Is there any way to get some feedback from the command line to give an idea how much longer I have to wait? When I go to my local download folder I see the file name but even after 25 mins it is still 0 bytes and I have no idea is something happening or nothing at all?

Cheers,

Flex

@FlexMcMurphy
Copy link
Author

I wonder if my problem is that username:password auth no longer works from docker because O'Reilly recently implemented a bot system to block that method without cookies lorenzodifuccia/safaribooks#346 (comment)

I could also be totally wrong but last night I waited nearly an hour for one book with approx 250 pgs to download but it didn't and I got no feedback on cli to say if something was going wrong or not.

Any help much appreciated.

Flex

@FlexMcMurphy
Copy link
Author

After some more testing I realise that because this docker container is a wrapper for the safaribooks solution the same fix that gets safaribooks working also gets oreilly-downloader working.

Basically username:password authentication no longer works instead you HAVE to use cookies. Can follow the method as per SSO-Login

I think the ReadMe should be updated to explain that username:pwd no longer works. Instead Cookies must be used with this kind of command:
(cat cookies.json | docker run -i kirinnee/orly:latest sso 9780138842228) > "My_eBook.epub"

You don't have to use Firefox to get the cookies it's just a bit easier, but you can use Chrome also where it's just a bit more awkward. There are about TEN Request cookies from the profile/ request you can see them in Web Developer Tools.

If you run this command from the Web Developer console:
console.log(JSON.stringify(document.cookie.split(';').map(c => c.split('=')).map(i => [i[0].trim(), i[1].trim()]).reduce((r, i) => {r[i[0]] = i[1]; return r;}, {})))
... it gets most but not all of them. You could simply copy and paste the 3 or 4 it misses, one by one.

These are the names of all the cookies I used in my cookies.json...

{
    "AMP_MKTG_49f7a68a85":"",
    "akaalb_LearningALB":"",
    "ak_bmsc":"",
    "bm_sz":"",
    "orm-jwt":"",
    "orm-rt":"",
    "groot_sessionid":"",
    "_abck":"",
    "bm_sv":"",
    "AMP_49f7a68a85":""
}

I haven't tested but I think maybe you only need: "bm_sz", "bm_sv", "orm-jwt", "orm-rt" and "groot_sessionid".

Just my opinion but after trying out both this and safaribooks I think the My O'Reilly Downloader Chrome Plugin extension is way easier to use, just works and creates a .epub file that is about exactly the same as how the eBook looks on the oReilly website which is what we want after all. The epub file created by this docker and safaribooks by comparison have ugly fonts that are poorly formatted.

Flex

@FlexMcMurphy FlexMcMurphy changed the title No output feedback indicating download progress oReilly Username/Password authentication not working Sep 7, 2023
@dannyyy
Copy link

dannyyy commented Feb 11, 2024

Thanks for your investigation. I renewed my subscription these days and saw, that this project is broken. Now I have to adjust my workflow a bit by using the Chrome extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@dannyyy @FlexMcMurphy and others