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

Failed to fetch entire book, only fetches chapters #290

Open
KonScanner opened this issue Oct 1, 2021 · 9 comments
Open

Failed to fetch entire book, only fetches chapters #290

KonScanner opened this issue Oct 1, 2021 · 9 comments
Labels

Comments

@KonScanner
Copy link

Fetches book normally, but only the chapters.

@obar1
Copy link

obar1 commented Oct 1, 2021

which book plz share isbn

@KonScanner
Copy link
Author

Every single book I try to download has this, It fetches the first page of each chapter only.

Example ISBNs:
9780135183762, 9781492075325

Python version: Python v.3.9.5

Reqs:

$ pip3 freeze | grep 'lxml\|requests'
lxml==4.6.3
requests==2.25.1
requests-unixsocket==0.2.0

@lorenzodifuccia
Copy link
Owner

Note: currently there is a bug for the images.
However, have you tried to clean the epub from this script with Calibre?
Read: https://github.com/lorenzodifuccia/safaribooks#calibre-epub-conversion

@AleksanderBrzozowski
Copy link

Yep, images are fetched as htmls with 404 page :(

urls have been changed from:

https://learning.oreilly.com/library/view/service-mesh-patterns/9781492086444/assets/canary_deployments_635499_02.png

to

https://learning.oreilly.com/api/v2/epubs/urn:orm:book:9781492086444/files/assets/how_to_get_started_with_any_service_mesh_128401_01.png

@lorenzodifuccia are you able to update script? ;)

@KonScanner
Copy link
Author

Note: currently there is a bug for the images. However, have you tried to clean the epub from this script with Calibre? Read: https://github.com/lorenzodifuccia/safaribooks#calibre-epub-conversion

I have tried this, I think it just fails to fetch the files post the initial chapter page. I think it's due to the URL and type of loading changes they've made.

@lorenzodifuccia lorenzodifuccia added help wanted need more info Please provide more info to address the issue labels Oct 25, 2021
@dserodio
Copy link

dserodio commented Feb 17, 2022

Same here, tried to convert https://learning.oreilly.com/library/view/dynamic-reteaming-2nd/9781492061281/, and even after converting with ebook-convert, I got a bunch of errors and I only have the first page in every chapter (even the Foreword, which doesn't have any images).
Should I attach the "log" output to this issue?
Thanks!

@dserodio
Copy link

Note: The downloaded XHTML files (ch01.xhtml, ch02.xhtml…) themselved are truncated and only show a couple of paragraphs ending in an ellipsis, so it seems the problem is in the downloading code, not the "ebook rendering" code.

@ywriterct
Copy link

have the same issue, any updates or workaround?

@ywriterct
Copy link

hi i found the solution. the partial chapters were downloaded when i ran python3 safaribooks.py --cred "[email protected]:MyPassword1!" 9781491958698. once i authenticated w/ my usn:pw and just ran python3 safaribooks.py 9781491958698 after successfully authenticating the full book downloaded

@lorenzodifuccia lorenzodifuccia added wontfix and removed help wanted need more info Please provide more info to address the issue labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants