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

Kindle Scribe Cover generation after mtp firmware #508

Closed
axu2 opened this issue May 5, 2023 · 11 comments · Fixed by #767
Closed

Kindle Scribe Cover generation after mtp firmware #508

axu2 opened this issue May 5, 2023 · 11 comments · Fixed by #767
Labels
Kindle Kindle device

Comments

@axu2
Copy link
Collaborator

axu2 commented May 5, 2023

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 axu2 changed the title Add processing time metric to UI better logging ideas May 9, 2023
@axu2 axu2 changed the title better logging ideas Display warning that Kindle Scribe must be connected for cover upload Jul 5, 2023
@axu2 axu2 changed the title Display warning that Kindle Scribe must be connected for cover upload manually generate thumbnails when kindle not connected. Sep 25, 2023
@axu2 axu2 changed the title manually generate thumbnails when kindle not connected. generate covers when kindle not connected for later transfer Sep 26, 2023
@axu2 axu2 changed the title generate covers when kindle not connected for later transfer generate covers when kindle scribe not connected for later transfer Nov 19, 2023
@axu2 axu2 changed the title generate covers when kindle scribe not connected for later transfer Kindle Scribe Cover generation after mtp firmware Nov 29, 2023
@axu2 axu2 added the Kindle Kindle device label Dec 6, 2023
@pretenderlu
Copy link

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

@axu2
Copy link
Collaborator Author

axu2 commented Feb 9, 2024

@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.

@pretenderlu
Copy link

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

@axu2
Copy link
Collaborator Author

axu2 commented Feb 10, 2024

@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.

@pretenderlu
Copy link

@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.

@jaroslawjanas
Copy link
Contributor

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.

@tomsem
Copy link

tomsem commented May 15, 2024

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.

@jaroslawjanas
Copy link
Contributor

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.

@axu2
Copy link
Collaborator Author

axu2 commented May 17, 2024

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

@tomsem
Copy link

tomsem commented May 19, 2024

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.

@axu2
Copy link
Collaborator Author

axu2 commented Nov 3, 2024

@axu2 axu2 closed this as completed in #767 Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kindle Kindle device
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants