-
Notifications
You must be signed in to change notification settings - Fork 696
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
Truncated ( ... ) download still happening even after #133 fix #150
Comments
Same here. |
+1 |
3 similar comments
+1 |
+1 |
+1 |
I have the same issue |
+1 |
I have the same problem. It seems to me that the problem is the login. Even though you get a 200 response-code when logging in, you never get a sessionid-cookie, and for that reason when requesting the chapters you are treated as if you are not logged in, resulting in the truncations - at least that's how it looked to me when I was trying to understand what is going on (not sure if it helps...). |
The above PR fixes this issue for me |
Your fix worked fine for me too. Thanks a lot for your work! |
I tried a couple of downloads, and mostly the epubs are not really usable. @elrob : However, this is not the fault of your fix. |
Still having issues :( even with #152 |
@manfredlotz This issue is about the truncation of output as if you're not logged in. The PR I created doesn't change anything in the epub creation. I have had no issues with three books I've since tested with. Definitely usable for me. Can you give me an example of a book you've had issues with? And what those issues are? |
@milktea02 What issues are you having? Are they related to truncation (this github issue tracks the truncation problem)? |
I have tried the same book again ( 9781491908419 ). I am able to see contents now without ellipsis. But when I click chapter 6, it takes me to last page of chapter 6 properly, but shows chapter 5 as highlighted on the left hand side layout. Guess this is some minor stuff. |
@mukuntharajaa Thanks for the response. If it is an issue you would like to raise and get fixed then I recommend creating a new github issue for it. This github issue was around the truncation of chapters due to authentication issues. So for now, if/when @lorenzodifuccia accepts #152 then github issue would be fixed. |
can we try this code please |
@varta2014 If you want to try my change before it is merged into this repository then you can just pull it from https://github.com/elrob/safaribooks |
@elrob Unfortunately, I don't remember which book download I tried. I know that FBReader crashed when opening the epub. The last downloads I did were ok. |
@elrob Tried Clean Code (9780136083238) and still get truncation. I'm logging in via SSO if that might be the issue. |
I am having truncation with book: 9781119449270 in this area: https://learning.oreilly.com/library/view/professional-c-7/9781119449270/fintro.xhtml Thanks |
@milktea02 I have updated my change to restore the code that I thought was unnecessary. It was unnecessary for me but I'm not using SSO. Maybe you can try the latest version of my branch and see if it works for you now. I don't have SSO so I can't test it myself. @AsimShakour Are you using SSO too? Maybe that's the problem. Can you also try with the latest change I have made (updated just now). |
elrob thank you code work perfect ! |
Just tested it with |
For those of you still having trouble: delete the Books directory that is created for the downloads. Then retry your download. I found that the tool will not re-download chapters it thinks are already there. I was able to download book 9781119558439 without any problems. Not familiar, but it seemed complete. |
Tried it 3 times in a row, issue is still the same for |
I have also tried downloading this ebook and accessed random pages, @elrob`s fix is working fine. |
Check the Chapter beginnings... it only captures a couple of lines, the rest is truncated... |
please provide images or video to get cookies.json file from inpection in mac |
@azmatsiddique ahhaha are you serious |
Thanks a lot guys! Works splendidly. |
can you help me I'm trying to download also !! |
how to solve !! |
i cant get the cookies.json file either. Any clue where to get it ? |
Below script works for me. 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;}, {}))) |
I was unable to right click Then, I executed |
This does not work anymore |
I could use it perfectly fine, after trouble I had to obtain the cookies in the right structure.
|
Using this with Chrome in mid 2022 and it seems to be the easiest approach by far. Copy-pasted into |
might add PR later, but for now, I've provided my own solution based on
|
worked again with Chrome in July 2023. Copy the returned json to cookies.json, and download was successful. |
@domrany64's answer still works! |
I am not finding the "name": "orm-jwt", or just "orm-jwt" in the cookies at all. Is it still working for others? |
Looks like it's the Cookie-Editor extension that didn't get all the cookies. |
This method generally worked for me per @albertocavalcante's post This tool is a lifesaver for anyone who gets access to this site via their library (like SFPL) since the institutional login UI is completely useless and doesn't save your reading progress, lists, or anything else. Not sure how anyone uses the site at all without a tool like this one |
Like some others, I have an SSO login to O'Reilly and had trouble with the script as it is in the master branch. @albertocavalcante 's method, combined with the dev tools one-liner by @akriaueno fixed everything and the tool works easily now. Just save the output of the dev tools script into Thank you both for your debugging and guides. |
create a file 'cookies.json' in the same folder as safaribooks, then open F12 in the sonsole tab and paste the following string to get cookies, copy all the returned values and save them to cookies.json. then run the command 'python safaribooks.py xxxxx' where xxxxx is your document code |
For people hitting the error response = getattr(self.session, "post" if is_post else "get")(
url,
data=data,
allow_redirects=True,
**kwargs
) |
I am on master branch and currently updated to Oct 14 2019 commit. Still I am seeing truncated chapter downloads.
Book id: 9781491908419
Chapter 2: Item 5: second page shows "..." and Item 6 is altogether missing.
Please let me know, if any further information is required.
The text was updated successfully, but these errors were encountered: