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

Books AND PDFs, not only books #10

Open
vongohren opened this issue Dec 26, 2020 · 5 comments
Open

Books AND PDFs, not only books #10

vongohren opened this issue Dec 26, 2020 · 5 comments

Comments

@vongohren
Copy link

My kindle app syncs docs(PDFs and other) and their notes as well. Which is really really nice!

It seems that this fiona endpoint do not sync docs(PDFs and other), only books, so I wonder if you have seen anything in that direction?

I cant see any good enpoint fetching this data

@ptbrowne
Copy link
Owner

ptbrowne commented Dec 26, 2020

Am not sure that those PDFs are saved on Amazon side, so I do not think that they would be available through the "fiona" API.

Mmh I had misread your comment initially.. No I have not yet seen how notes and PDFs are synced to Amazon.

@vongohren
Copy link
Author

@ptbrowne if you try https://www.fivefilters.org/push-to-kindle/ on whatever website or blogpost you find. I suggest trying it on feks this page: https://waitbutwhy.com/2015/05/elon-musk-the-worlds-raddest-man.html. Worth reading that whole series :P

Then you get a PDF on your kindle that you read, and you can see that the mobile app is able to sync that PDF, together with the notes you make. So I wonder what API covers this data.

Did you get a proper reverse engineer result, because I struggle to get the HTTPS decoded, I dont have a nice setup of raspberry PI here, and tried other proxies, but I dont get the HTTP/CONNECT calls to be readable

@vongohren
Copy link
Author

I guess it has to do with Nougat 7 and the network policy, and why you have said to use an android 5.0 emulator. Have to try that tomorrow

@vongohren
Copy link
Author

vongohren commented Dec 27, 2020

@ptbrowne Im finding this url: https://api.amazon.com/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?after=6734&embed=records.first_page

With this result where :

{
  "datasets": [],
  "links": {
    "future": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?after=6734",
    "next": null,
    "prev": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?embed=records.first_page&before=6735",
    "subscriptions": "/whispersync/v2/data/amzn1.account.[accountnumber]/directory/subscriptions",
    "updates": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?after=6734"
  }
}

But struggeling to get the app behaving correctly when doing proxy and installing a different root certificate. It wont log in, and struggeling to download data.

The kindle app do seriously have some safety mechanisms :P I cannot find it on play store when doing an emulator any more. Had to dig up my old nexus and boot it back to android 6 just to get to this point.

Did you have this much trouble when looking for the URLs?

@vongohren
Copy link
Author

vongohren commented Dec 27, 2020

Some updates:

This seems to be the right link for proper whispersync data. I did some changes/finsih reading/downloading a pdf and the dataset updated itself. So I got some dataset. I believe this is using hypermedia rest with HAL standard as talked about here: https://reflectoring.io/rest-hypermedia/. So the next issue would be to get the right signature, as you have done in this repo. Because I could not use the same headers for those hypermedia links, and there is a header called:

x-adp-signature

Lets hope that code you are using works for this header aswell :D

But here is an updated response:

{
    "datasets": [
        {
            "identifier": "18bbba3c-52df-43cc-9153-de8c8d6f681c",
            "isDeleted": false,
            "lastUpdatedTime": "2020-12-27T16:43:54Z",
            "links": {
                "future": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/18bbba3c-52df-43cc-9153-de8c8d6f681c/records?after=6735",
                "next": null,
                "prev": null,
                "records": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/18bbba3c-52df-43cc-9153-de8c8d6f681c/records",
                "self": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/18bbba3c-52df-43cc-9153-de8c8d6f681c",
                "subscriptions": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/18bbba3c-52df-43cc-9153-de8c8d6f681c/subscriptions",
                "updates": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/18bbba3c-52df-43cc-9153-de8c8d6f681c/records"
            },
            "name": "Decks4_3BZHEUY7DSAFHZYORYSLEED5PJJAMHX6",
            "namespace": "LearningDecks",
            "owner": "amzn1.account.[accountnumber]",
            "records": {}
        },
        {
            "identifier": "6fa073fc-dc2a-4d65-9bfe-8acd4cf2eb7b",
            "isDeleted": false,
            "lastUpdatedTime": "2020-12-27T16:43:57Z",
            "links": {
                "future": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/6fa073fc-dc2a-4d65-9bfe-8acd4cf2eb7b/records?after=6736",
                "next": null,
                "prev": null,
                "records": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/6fa073fc-dc2a-4d65-9bfe-8acd4cf2eb7b/records",
                "self": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/6fa073fc-dc2a-4d65-9bfe-8acd4cf2eb7b",
                "subscriptions": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/6fa073fc-dc2a-4d65-9bfe-8acd4cf2eb7b/subscriptions",
                "updates": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets/6fa073fc-dc2a-4d65-9bfe-8acd4cf2eb7b/records"
            },
            "name": "DeckModifiers4_3BZHEUY7DSAFHZYORYSLEED5PJJAMHX6",
            "namespace": "LearningDecks",
            "owner": "amzn1.account.[accountnumber]",
            "records": {}
        }
    ],
    "links": {
        "future": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?after=6736",
        "next": null,
        "prev": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?embed=records.first_page&before=6735",
        "subscriptions": "/whispersync/v2/data/amzn1.account.[accountnumber]/directory/subscriptions",
        "updates": "/whispersync/v2/data/amzn1.account.[accountnumber]/datasets?after=6736"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants