devnoname120 / google-play-book-downloader

Download and decrypt books purchased on Google Play Books without text reflowing
GNU Affero General Public License v3.0
60 stars 4 forks source link

Missing Pages #7

Closed mslmn closed 4 months ago

mslmn commented 1 year ago

I'm getting this error when I run the script. Error! Couldn't find a download link for 128 pages (79% missing, total: 162 pages). Make sure that the FETCH_OPTIONS object is valid and that you own the book. I can read all the pages in the browser.

mslmn commented 8 months ago

still getting the same error.

duffy6 commented 8 months ago

Same issue! any news?

currythecoder commented 7 months ago

I did some troubleshooting and found out why it happened: with some books, the program grabs the manifest.json for the free preview of the book (the one you see without an account), rather than the actual book.

For me, this workaround worked for downloading manga:

  1. Have your book open in Google Play in a Chromium browser
  2. Open Dev Tools, then go to the Sources section
  3. In the source books/reader?id=<bookID>&pg=<page>, there should be a script that lists a series of the page URLs. (It may require refreshing the page to see.)
  4. Copy the text from {metadata to ...contains_image_bubbles": false}
  5. Make a new file called manifest.json in the same directory asgoogle-play-book-downloader-pdf.mjs and paste it in there.
  6. When you edit google-play-book-downloader-pdf.mjs, IN ADDITION to what you would normally do (i.e., adding the book ID and the request header in their respective sections):
    1. Comment out the lines beginning with:
      1. const manifest_text
      2. const manifest
      3. await fs.writeFile
    2. Add this line to the top: import manifest from "./manifest.json" assert { type: 'json' };

You will need to repeat Steps 3 to 5 for each book you want to download (i.e. grab the series of URLs from the page source, and overwrite manifest.json with them each time).

devnoname120 commented 7 months ago

@currythecoder Thank you for the investigation. It seems that the manifest indeed limits the number of page images now. We may need to migrate to using the content embedded in the page itself (it used to be incomplete iirc but now it looks good…)

Is the metadata.preview property in your manifest.json equal to partial or full?

devnoname120 commented 4 months ago

@currythecoder Bump

michael753-yen commented 4 months ago

same issue

devnoname120 commented 4 months ago

@michael753-yen Are you using the latest version? It's in Python now.