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

Book list contains items that cannot be downloaded #4

Closed
ghost opened this issue Apr 29, 2019 · 7 comments
Closed

Book list contains items that cannot be downloaded #4

ghost opened this issue Apr 29, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Apr 29, 2019

The python kobo-book-downloader list --all currently shows five books, but I can download only one of them (because I bought it). Two other books are on the list because I bought them in the past but then I successfully requested a refund. Other two books are on the list because they are on my wishlist. But please notice I have a lot of other books on my wishlist that don't appear in the kobo-book-downloader list.

Is it possible to avoid displaying books that I cannot download?

@ghost
Copy link
Author

ghost commented Apr 29, 2019

It seems the last two books I mentioned are not listed because they are on my wishlist but because they are on the "My Books" page along with the books I bought. They are probably there because I clicked on "Save Preview".

@TnS-hun
Copy link
Owner

TnS-hun commented May 1, 2019

They are probably there because I clicked on "Save Preview".

That was very helpful, I could test it this way. Thank you! Those books are now filtered. The code I added could've helped with the refunded books too. Can you test it please?

@ghost
Copy link
Author

ghost commented May 1, 2019

Now books I added with "Save Preview" are no longer listed. And that's good. But the refunded book is still on the list.

$ python kobo-book-downloader list --all
4b69ebfc-04d2-4a49-a79a-2fe3ee9d0136 	 Famine, Affluence, and Morality by Peter Singer
8a85ffcc-b4bd-424a-8863-650743f6c04e 	 Getting Things Done by David Allen
26270e0d-5f8d-4dd0-b0eb-643759f8eb24 	 Prepariamoci by Luca  Mercalli

I bought the 1st and 3rd book and I still own them, but I no longer have the 2nd book because I got a refund.

@TnS-hun
Copy link
Owner

TnS-hun commented May 1, 2019

Can you modify Commands.py at line 199 locally to the following?

			rows.append( book )
			import json; print( bookMetadata[ "Title" ] + "\n" + json.dumps( bookEntitlement, indent="  " ) )

		rows = sorted( rows, key = lambda columns: columns[ 1 ].lower() )

Once you run kobo-book-downloader with the list command again, it will output something like this:

Book title
{
  "ActivePeriod": {
    "From": "2018-04-29T19:07:31.0000000Z"
  },
  "IsRemoved": false,
  "Status": "Active",
  "Accessibility": "Full",
  "CrossRevisionId": "...",
  "RevisionId": "...",
  "IsHiddenFromArchive": false,
  "Id": "...",
  "Created": "2018-04-29T19:07:31.0000000Z",
  "LastModified": "2018-04-29T19:07:31.0000000Z",
  "IsLocked": false,
  "OriginCategory": "Purchased"
}

I have edited out the CrossRevisionId, RevisionId and Id fields just to be on the safe side. I'm mostly interested in the IsRemoved, Status, IsHiddenFromArchive, IsLocked and OriginCategory fields. Please post at least those here.

@ghost
Copy link
Author

ghost commented May 1, 2019

$ python kobo-book-downloader/kobo-book-downloader list --all
Prepariamoci
{
  "ActivePeriod": {
    "From": "2019-04-28T20:37:05.0000000Z"
  },
  "IsRemoved": false,
  "Status": "Active",
  "Accessibility": "Full",
  "CrossRevisionId": "ec9dd622-ec8f-3fa2-bc21-32a1b6609d24",
  "RevisionId": "26270e0d-5f8d-4dd0-b0eb-643759f8eb24",
  "IsHiddenFromArchive": false,
  "Id": "0316ae00-7004-4957-b736-195e374b3061",
  "Created": "2018-11-12T22:48:19.0000000Z",
  "LastModified": "2019-04-28T20:37:05.0000000Z",
  "IsLocked": false,
  "OriginCategory": "Purchased"
}
Famine, Affluence, and Morality
{
  "ActivePeriod": {
    "From": "2019-04-29T21:38:56.0000000Z"
  },
  "IsRemoved": false,
  "Status": "Active",
  "Accessibility": "Full",
  "CrossRevisionId": "442da6e4-316b-3910-9c31-98fc9666242b",
  "RevisionId": "4b69ebfc-04d2-4a49-a79a-2fe3ee9d0136",
  "IsHiddenFromArchive": false,
  "Id": "b2180365-945a-4750-8017-1fb6237bed9f",
  "Created": "2019-03-09T21:37:38.0000000Z",
  "LastModified": "2019-04-29T21:38:56.0000000Z",
  "IsLocked": false,
  "OriginCategory": "Purchased"
}
Getting Things Done
{
  "ActivePeriod": {
    "From": "2018-12-31T13:46:36.0000000Z"
  },
  "IsRemoved": false,
  "Status": "Active",
  "Accessibility": "Full",
  "CrossRevisionId": "b6856875-e6bd-3172-9bcf-5fc2dd00b590",
  "RevisionId": "8a85ffcc-b4bd-424a-8863-650743f6c04e",
  "IsHiddenFromArchive": false,
  "Id": "fb94c54b-70fb-497d-8bcc-54fec66a54a7",
  "Created": "2018-12-31T13:46:36.0000000Z",
  "LastModified": "2019-01-04T00:29:57.0000000Z",
  "IsLocked": true,
  "OriginCategory": "Purchased"
}
4b69ebfc-04d2-4a49-a79a-2fe3ee9d0136     Famine, Affluence, and Morality by Peter Singer
8a85ffcc-b4bd-424a-8863-650743f6c04e     Getting Things Done by David Allen
26270e0d-5f8d-4dd0-b0eb-643759f8eb24     Prepariamoci by Luca  Mercalli

@TnS-hun
Copy link
Owner

TnS-hun commented May 2, 2019

Thank you.

It looks like it was the IsLocked field. The book should be hidden in the latest version.

@ghost
Copy link
Author

ghost commented May 2, 2019

It works now:

$ python kobo-book-downloader list --all
4b69ebfc-04d2-4a49-a79a-2fe3ee9d0136     Famine, Affluence, and Morality by Peter Singer
26270e0d-5f8d-4dd0-b0eb-643759f8eb24     Prepariamoci by Luca  Mercalli

Thank you!

@ghost ghost closed this as completed May 2, 2019
This issue was closed.
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

1 participant