kcc icon indicating copy to clipboard operation
kcc copied to clipboard

Kindle Scribe Cover generation after mtp firmware

Open axu2 opened this issue 1 year ago • 10 comments

Would be nice to have option to manually upload covers after the fact for longer batch conversions without needing kindle plugged in.

Additionally, Kindle Scribe uses MTP so cover upload no longer works.

https://www.mobileread.com/forums/showthread.php?t=355924&highlight=mtp

Hacky workaround

TLDR use kcc normally with a special flash drive inserted.

  1. Plug in a flash drive that will pretend to be kindle. Must be fat32 or msdos fat
  2. Create system/thumbnails and documents folders at root of flash drive. Based on https://github.com/ciromattia/kcc/blob/master/kindlecomicconverter/kindle.py#L42
  3. Convert with KCC and thumbnails will be generated there.
  4. Copy the thumbnails onto your Scribe in the appropriate location. On Mac use MTP client Android File Transfer. Remember, on mac/linux only 1 program can access mtp at a time, so any other book transfer software running will interfere
  5. Copy your books AFTER the thumbnails to avoid the Kindle blanking them out.

To create a fake physical flash drive, refer to https://support.apple.com/guide/disk-utility/create-a-disk-image-dskutl11888/mac and use msdos format.

image

On Windows https://learn.microsoft.com/en-us/windows-server/storage/disk-management/manage-virtual-hard-disks use FAT not FAT32. 100 mb should be good, default on mac.

axu2 avatar May 05 '23 23:05 axu2

This looks absolutely fantastic! I wonder if it's feasible?

pretenderlu avatar Feb 09 '24 09:02 pretenderlu

@pretenderlu what's not feasible? The workaround works but I'm not sure if it's possible to automate like before.

If anything this is more convenient since kindle doesn't need to be plugged in.

axu2 avatar Feb 09 '24 15:02 axu2

Yes, what I mean is I don't know if it can be fully automated. If full automation is possible, that would be perfect.

pretenderlu avatar Feb 10 '24 02:02 pretenderlu

@pretenderlu May be possible with a python library that supports MTP. the biggest issue is that Mac and Linux prevent more than one MTP connection, so Android File Transfer running will interfere. Android File Transfer is required on Mac to transfer the mobis and auto starts when kindle is plugged in.

axu2 avatar Feb 10 '24 04:02 axu2

@axu2 Indeed, it seems inevitable that human intervention is needed. However, the ability to directly generate corresponding comics and covers is already great, and manually operating one step is also very convenient.

pretenderlu avatar Feb 11 '24 14:02 pretenderlu

It's a lot of effort, to be honest. I just hope Calibre fixes it soon since it's what I have been using to sideload all of my content.

jaroslawjanas avatar Mar 20 '24 02:03 jaroslawjanas

It is fully automatable, in theory.

But there is effectively no Python library for MTP. For example, this one doesn't work on Python 3, and has not been updated in over 12 years: https://pypi.org/project/PyMTP/

The closest thing to a Python MTP library is what calibre has, but it would need refactoring to use outside of calibre. Ideally, that is what KCC would use.

Another option would be to call command line tools from Python.

On Windows, you can use Powershell commands to automate Windows Explorer (e.g. [https://github.com/nosalan/powershell-mtp-file-transfer]).

On macOS (and maybe Linux), installing libmtp (e.g. 'brew install libmtp') provides a set of command line tools, like mtp-folders, mtp-sendfile, mtp-getfile, etc.

tomsem avatar May 15 '24 22:05 tomsem

The closest thing to a Python MTP library is what calibre has, but it would need refactoring to use outside of calibre. Ideally, that is what KCC would use.

Well... I wouldn't mind seeing KCC being implemented into Calibre as a plugin since we are on the topic.

jaroslawjanas avatar May 15 '24 22:05 jaroslawjanas

KCC calls lots of command lines tools like kindlegen, 7z, etc. it wouldn't be unusual to do mtp as well.

axu2 avatar May 17 '24 05:05 axu2

It is fully automatable, in theory.

But there is effectively no Python library for MTP. For example, this one doesn't work on Python 3, and has not been updated in over 12 years: https://pypi.org/project/PyMTP/

I think I have got it working!

It is just one Python file (pymtp.py), and after running 2to3 and changing 2 other lines of code that for some reason were calling dunder methods (probably something to do with an older MTP library), I'm able to run example code (also updated with 2to3).

I think one can just add the migrated pymtp.py to a project, and as long as the MTP C library is installed on system, it will just work without needing to pip install anything.

tomsem avatar May 19 '24 18:05 tomsem