Closed NomadThanatos closed 3 years ago
Anyway still can use Selenium to mimic the behavior and try to parse the result, wonder whether there is a better solution.
There is a authorization: bearer ***** in request not in directly accessing this URL.
After adding this key to the header, everything works fine, only issue here is what is this key.
This key does not change between logins and books, not sure it is per user or what level.
Need further investigate about how to get this token. https://github.com/NomadThanatos/readmoo-dl/blob/master/lib/readmoo_dl/downloader.rb#L42
For now this token can be obtained by below method.
nav
request, check request header to get the token authorization: bearer ********
During a local check on my machine, it is observed that:
https://new-read.readmoo.com/mooreader/<book_id>
page there is a readmoo_access_token
cookie returned. Full example: set-cookie: readmoo_access_token=<token>; expires=<timestamp>; Max-Age=30; path=/oauth; domain=.readmoo.com; secure; SameSite=None
.authorization: Bearer <token>
when accessing https://api.readmoo.com/store/v3/me
and several other links.By the way, the origin of such token as shared above may be located with the help of a browser's developer tools window:
Ctrl + F
and search for the value.Ctrl + Shift + F
and search for the value.@starrify Thanks for your help.
After trying to search this token TWBLXfuP-NbtCrjD2PAiFA
I think this is some public key from here, I verify this from incognito mode.
Not sure about the rotation period, so I will hard code this for now.
Request:
https://reader.readmoo.com/api/book/210080417000101/nav
Expected:
Actual:
{"message":"not found","nav_dir":""}
Comments:
I use Chrome debug tool to get the expected value, then I paste the link in Chrome again, it actually returns the unexpected value. My first investigation/assumption is this is controlled by AWS Cloudfront policy.