Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-05-2017, 03:10 PM   #1
TnS
Junior Member
TnS began at the beginning.
 
Posts: 8
Karma: 19
Join Date: Nov 2017
Device: Kobo Aura One
kobo-book-downloader

With kobo-book-downloader you can download your purchased Kobo books and remove the DRM protection from them. The resulting EPUB files can be read with, amongst others, KOReader.

Unlike obok.py, kobo-book-downloader doesn't require any pre-downloading through a Kobo e-reader or application.

kobo-book-downloader is a command line program. It looks like this:
https://raw.githubusercontent.com/Tn...screenshot.png


After reading the posting guidelines about DRM, it wasn't exactly clear to me if posting this is okay or not. But I think it's okay if this DeDRM post is allowed.
TnS is offline   Reply With Quote
Old 11-05-2017, 03:23 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,018
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
You really need to say that this gets you a kepub. Not everybody wants kepub.
JSWolf is offline   Reply With Quote
Old 11-05-2017, 11:29 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,648
Karma: 168431795
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Tns: I tested under Windows 10 x64 with Python 3.6.3. When I did individual file downloads, the books that did download looked fine. An attempt to use --all did not work. For failed single books and --all, the error message was "ERROR: Download URL for supported formats can't be found for product '0123beef-face-deaf-abed-feed5678deed'." A quick check on the Kobo site showed that these were books that I had archived. Perhaps your code could be extended to distinguish books in a user's library from those that have been archived.

Jon: Console yourself with the thought that the file names are human readable making it easier to know what the book is while Calibre's Modify Epub plugin does a pretty decent job of cleaning out the Kobo spans.

Last edited by DNSB; 11-05-2017 at 11:33 PM.
DNSB is offline   Reply With Quote
Old 11-06-2017, 01:26 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by DNSB View Post
Jon: Console yourself with the thought that the file names are human readable making it easier to know what the book is while Calibre's Modify Epub plugin does a pretty decent job of cleaning out the Kobo spans.
And there is enough support in calibre for kepubs that adding the kepub and letting the user do a conversion/cleanup should be OK. And it allows them to use the kepub if they want to.
davidfor is offline   Reply With Quote
Old 11-07-2017, 05:39 PM   #5
TnS
Junior Member
TnS began at the beginning.
 
Posts: 8
Karma: 19
Join Date: Nov 2017
Device: Kobo Aura One
Quote:
Originally Posted by JSWolf View Post
You really need to say that this gets you a kepub. Not everybody wants kepub.
Is there any real difference beside the added Kobo spans?

Quote:
Originally Posted by DNSB View Post
Perhaps your code could be extended to distinguish books in a user's library from those that have been archived.
Archived books are now skipped during get --all.

Unfortunately the API doesn't give back decryption keys for those, so while they could be downloaded, they couldn't be decrypted.
TnS is offline   Reply With Quote
Old 11-12-2017, 02:57 AM   #6
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,648
Karma: 168431795
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by TnS View Post
Is there any real difference beside the added Kobo spans?
A few but none that seem to have much of a visible effect when reading using RMSDK.

Quote:
Originally Posted by TnS View Post
Archived books are now skipped during get --all.

Unfortunately the API doesn't give back decryption keys for those, so while they could be downloaded, they couldn't be decrypted.
Thanks for the change. I wasn't concerned with decrypting them since I move them to the archive after downloading and decrypting if needed so I already have my backup.

Edit: I now get 2 of the 71 books in my library when I do a get --all. The list --all also shows a small chunk of the 71 books in the library and 1327 books in the archive.

Wonder is this is an issue with a Japanese language ebook ( 猫が見るビデオブック:サンプル版 by Synforest)?

Nope, permanently deleted it and still no joy.

Last edited by DNSB; 11-12-2017 at 03:34 AM. Reason: Tested get --all functionality
DNSB is offline   Reply With Quote
Old 11-13-2017, 05:03 PM   #7
TnS
Junior Member
TnS began at the beginning.
 
Posts: 8
Karma: 19
Join Date: Nov 2017
Device: Kobo Aura One
So just make sure if I understand it correctly:
1) you have 71 non-archived books but list --all doesn't list them all
2) get --all downloads even less books than that are listed on the incomplete list made by list --all
3) after you deleted (?) that Japanese book the downloading still stopped after the same two books and there wasn't any error message

There is a difference between get --all and list --all, the latter sorts the list before displaying it. If you are adventurous you could try deleting or commenting out the following line in Commands.py:
Code:
rows = sorted( rows, key = lambda columns: columns[ 1 ] )
Then check if the first two books returned by list --all are the same that were successfully downloaded. What happens if you use get one by one?
TnS is offline   Reply With Quote
Old 11-14-2017, 02:14 AM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,648
Karma: 168431795
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by TnS View Post
So just make sure if I understand it correctly:
1) you have 71 non-archived books but list --all doesn't list them all
2) get --all downloads even less books than that are listed on the incomplete list made by list --all
3) after you deleted (?) that Japanese book the downloading still stopped after the same two books and there wasn't any error message

There is a difference between get --all and list --all, the latter sorts the list before displaying it. If you are adventurous you could try deleting or commenting out the following line in Commands.py:
Code:
rows = sorted( rows, key = lambda columns: columns[ 1 ] )
Then check if the first two books returned by list --all are the same that were successfully downloaded. What happens if you use get one by one?
1. Yes. Of the ~1398 books between library and archived, list --all and get --all shows ~300 of which 2 are not archived.

2. No. list --all returns only two books that are not archived. get --all downloads those two books.

3. Correct. I now get 1 less book returned by list --all and get --all.

When I pull both lists into Excel and then sorting, both lists contain the same books.

After I deleted the Japanese language book, both get and list returned one less result. No error message was displayed. Note the only two books are shown without the (archived) in list view are downloaded with get --all so that at least is consistent.

If I grab the book ID from the Kobo desktop application's kepub directory, the manual download works. The example below downloads The Icarus Hunt which does not show in either of the --all views.

Code:
python kobo-book-downloader get /kobo-book-downloader/books/ 7a19e0a2-4842-4160-bac6-9cfa960e6e95
As an experiment, I did a batch file which stepped through a list generated by a dir of the Kobo app's kepub directory and it successfully downloaded all 71 books. Some of the books that returned multiple authors did not have the book title in the file name (Evil is a Matter of Perspective as an example).

It appears that for some reason, my system is not returning all the results when using --all. Python version is 3.6.3 64 bit under Windows 10 x64.

Last edited by DNSB; 11-14-2017 at 02:39 AM. Reason: Fat fingers cause typos.
DNSB is offline   Reply With Quote
Old 11-14-2017, 05:25 PM   #9
TnS
Junior Member
TnS began at the beginning.
 
Posts: 8
Karma: 19
Join Date: Nov 2017
Device: Kobo Aura One
I think I've found the problem. I don't have 300 books to test it but there is a chance that my fix works.

Can you please test list --all with the latest version? If everything goes well it will list all your books. But what happens when you run list --all the second time? Does it show all your books again? I'm not so sure about this.
TnS is offline   Reply With Quote
Old 11-15-2017, 01:49 AM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,648
Karma: 168431795
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by TnS View Post
I think I've found the problem. I don't have 300 books to test it but there is a chance that my fix works.

Can you please test list --all with the latest version? If everything goes well it will list all your books. But what happens when you run list --all the second time? Does it show all your books again? I'm not so sure about this.
Running twice returned the same number of books. Oddly a greater number than I had gotten by adding library and archive numbers. I looked at the list and found quite a few duplicated book titles with different IDs.

Code:
8925493b-4444-4906-89a6-e4c699604a11     PERCEPTION by Lee Strauss (archived)
939c534e-0f79-49ca-969f-05033ba0faa3     PERCEPTION by Lee Strauss (archived)
Weird and wonderful. Running get --all downloaded 71 books as expected.
DNSB is offline   Reply With Quote
Old 11-15-2017, 02:09 AM   #11
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by DNSB View Post
Running twice returned the same number of books. Oddly a greater number than I had gotten by adding library and archive numbers. I looked at the list and found quite a few duplicated book titles with different IDs.

Code:
8925493b-4444-4906-89a6-e4c699604a11     PERCEPTION by Lee Strauss (archived)
939c534e-0f79-49ca-969f-05033ba0faa3     PERCEPTION by Lee Strauss (archived)
I have few books that I seem to have two copies of. Some were free first-on-series and somewhere along the way, Kobo got a new edition, but added it as a new book and removed the old. I could still download the old, but couldn't see the details in the store. For some, I deleted the old version and "bought" the new version.

I've also had a couple of problems with previews or wishlisted that kept appearing in those lists after buying the book. If I viewed the details, it would show that I had purchased it and allow me to read it. I suspect that some of these hit a problem like above and the book on the wishlist is not actually the book I ended up buying. There is some support in the database on the device to handle the relation between editions, but I haven't really looked at it.
davidfor is offline   Reply With Quote
Old 04-28-2019, 03:01 PM   #12
TnS
Junior Member
TnS began at the beginning.
 
Posts: 8
Karma: 19
Join Date: Nov 2017
Device: Kobo Aura One
After a long hiatus kobo-book-downloader has been updated.

Login got more complicated due to the captcha.

A new, more convenient, interactive way has been added to select the books to download. The command is called "pick". Yeah, that's how obok.py works. I don't remember why I didn't add this interactive picking originally.
TnS is offline   Reply With Quote
Old 12-27-2020, 01:50 PM   #13
subdavis
Junior Member
subdavis began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2020
Device: Kindle 7th Gen
Updating this thread for anyone who arrives from google search like I did.

kobo-book-downloader has been abandoned. It's completely broken, don't try to use it.

It has been replaced by https://github.com/subdavis/kobo-book-downloader

Apologies for necro/drive-by, but I think it's worth it for the update.
subdavis is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
downloader for ePapers (webreader) PackElend Reading and Management 0 08-22-2013 12:45 PM
LibriVox Downloader for Android pruss Android Devices 14 12-28-2011 06:07 PM
Android usenet downloader gertjan.stoker enTourage Archive 2 01-30-2011 09:16 AM
Google Book Downloader TadW News 4 02-19-2009 09:25 PM
(in)SECURE magazine Downloader cen iRex 1 04-23-2008 03:53 PM


All times are GMT -4. The time now is 11:37 PM.


MobileRead.com is a privately owned, operated and funded community.