tp86 / legimi-go

Unofficial Legimi ebook downloader for Kindle and Linux
MIT License
8 stars 0 forks source link

Fantastic job! #2

Closed 73rrto4r closed 4 months ago

73rrto4r commented 4 months ago

Hello again! First - well done, nice, clean, and quite clever. Code works, download works, issue with: legimi-go list -> on OSx: most of attempts gave "Error while executing command: decoding error: EOF" For second account it will not load the list at all (but will download) as book id's seem to be the same (as I accidentally tested it). All the best,

tp86 commented 4 months ago

Thanks for your feedback.

Issue with EOF while listing books is actually on my TODO list. I just haven't got time to work on code after initial release.

If download works, you don't have to list books at all. You can always obtain book IDs from book URLs. For example: https://www.legimi.pl/ebook-problem-trzech-cial-liu-cixin,b173281.html would have id 173281. Listing and copying from terminal is just more convenient.

I don't know entirely why listing books didn't work for second account. Probably better error handling would reveal something. I want to deal with it when I have some time.

tp86 commented 4 months ago

I took a look at EOF error and released new version that should fix it. Let me know if this works for you.

For issue of not loading the list for second account, you can double-check if you provided correct Kindle Serial Number. It happened to me that I entered partial serial number and it returned some value for the id, but listing books actually printed nothing (even no error).

73rrto4r commented 4 months ago

I just tested it. Same issues as before.

The accound that didn't list any files in previous version - didn't list any files this time around in the new version (I re entered serial number), download worked on that account - tried 20-30 times. ("Error while executing command: decoding error: EOF")

Errors on the other account: "Error while executing command: decoding error: EOF" "Error while executing command: decoding error: book metadata type should be 7, found 0" "Error while executing command: decoding error: book metadata type should be 7, found 24"

Last ones showed up before in previous version of legimi-go. In general EOF shows up most of the time, other ones ocassionally.

Please keep it in mind I am testing on OSx.

Great work!

tp86 commented 4 months ago

It shouldn't matter that you're on OSx, it looks rather like parts of protocol types that are not covered by the app. I'll try to find out what's wrong.

More important is that downloading works without issues.

tp86 commented 4 months ago

I am unable to reproduce on my side. I suspect there are some different types of books on your shelf that script cannot parse correctly and either tries to read more bytes than available (EOF) or ends up reading in wrong place (metadata type mismatch).

I prepared special version of script that write book list response to file (booklist.dump in current working directory). Is it ok for you to download this version, try to list books and share the resulting file with me? It won't contain your credentials or session id, just list of books on your shelf.

You can download this debugging version with go install github.com/tp86/legimi-go@book-list-debug, but you need to have Go installed. I don't want to prepare release for debugging purposes, but if you have trouble installing and running or don't want to install Go, let me know, I'll prepare executable.

73rrto4r commented 4 months ago

Hello hello,

My bad, for whatever reason the previous (correctly working version) didn't install. I was running on the old version. I only realised that when I installed 0.2.1 and later reinstalled 0.2.0. I don't know what happened and I am trully sorry for the trouble. No EOF present, checked both accounts.

Golden! works like a charm. If you want the debug file I can share it - but I believe there is no need.

Thanks a million for the work - amazing!!!!

If you need any other testing in the future, you can count me in. I get notifications about any new updates - so I will keep an eye as well.

tp86 commented 4 months ago

That's great news! I'm glad that it works. I was afraid that there are some uncovered types of books that you could download - this would be hard to fix without looking at raw data returned from server.

Now, as it works, there is indeed no need for you to share debug file.