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

Error! Couldn't find a download link for X pages #2

Closed kodxana closed 1 year ago

kodxana commented 1 year ago

Hi there! I'm trying to grab book I purchased. The script kinda works but getting issue on excution Any ideas?

[3ME0EAAAQBAJ] Script started
[3ME0EAAAQBAJ] Found AES decryption key: [44,169,2,207,181,130,27,200,87,169,70,82,93,135,165,199]
[3ME0EAAAQBAJ] Extracted the table of contents to toc.json
[3ME0EAAAQBAJ] Wrote human-readable table of contents to toc.txt
[3ME0EAAAQBAJ] Error! Couldn't find a download link for 164 pages (76% missing, total: 216 pages). Make sure that the FETCH_OPTIONS object is valid and that you own the book. List of missing pages: [PA51,PA52,PA53,PA54,PA55,PA56,PA57,PA58,PA59,PA60,PA61,PA62,PA63,PA64,PA65,PA66,PA67,PA68,PA69,PA70,PA71,PA72,PA73,PA74,PA75,PA76,PA77,PA78,PA79,PA80,PA81,PA82,PA83,PA84,PA85,PA86,PA87,PA88,PA89,PA90,PA91,PA92,PA93,PA94,PA95,PA96,PA97,PA98,PA99,PA100,PA101,PA102,PA103,PA104,PA105,PA106,PA107,PA108,PA109,PA110,PA111,PA112,PA113,PA114,PA115,PA116,PA117,PA118,PA119,PA120,PA121,PA122,PA123,PA124,PA125,PA126,PA127,PA128,PA129,PA130,PA131,PA132,PA133,PA134,PA135,PA136,PA137,PA138,PA139,PA140,PA141,PA142,PA143,PA144,PA145,PA146,PA147,PA148,PA149,PA150,PA151,PA152,PA153,PA154,PA155,PA156,PA157,PA158,PA159,PA160,PA161,PA162,PA163,PA164,PA165,PA166,PA167,PA168,PA169,PA170,PA171,PA172,PA173,PA174,PA175,PA176,PA177,PA178,PA179,PA180,PA181,PA182,PA183,PA184,PA185,PA186,PA187,PA188,PA189,PA190,PA191,PA192,PA193,PA194,PA195,PA196,PA197,PA198,PA199,PA200,PA201,PA202,PA203,PA204,PA205,PA206,PA207,PA208,PA209,PA210,PA211,PA212,PA213,PA214]
[3ME0EAAAQBAJ] Starting to download 216 pages…
TypeError: err is not a function
devnoname120 commented 1 year ago

Hmmmm let me see maybe they changed their protection? Does the decryption work with the changes that I just pushed?

kodxana commented 1 year ago

[3ME0EAAAQBAJ] [1/216] Error! Download or decrypt failed (url: https://play.google.com/books/publisher/content?id=) failed with The operation failed for an operation-specific reason OperationError: The operation failed for an operation-specific reason at new DOMException (node:internal/per_context/domexception:53:5) at __nodeinternal (node:internal/util:609:10) at AESCipherJob.onDone (node:internal/crypto/util:273:19) at AESCipherJob.callbackTrampoline (node:internal/async_hooks:130:17)

The link gives correct looking image file though
devnoname120 commented 1 year ago

Ah I think I got it.

Could you try to remove all the properties except headers from the FETCH_OPTIONS object? E.g. method, body, referrerPolicy, etc.

kodxana commented 1 year ago

No changes

devnoname120 commented 1 year ago

Closing because the issue was that the headers object was not copied correctly.