View Single Post
Old 12-02-2023, 02:01 AM   #1
xxyzz
Evangelist
xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.
 
Posts: 418
Karma: 2666666
Join Date: Nov 2020
Device: none
How to upload file to Kindle Scribe?

I want to upload a file to path like `documents/book_name.sdr/LanguageLayer.en.asin.kll` and I'm using this code:

Code:
def upload_file_to_kindle_mtp(driver: Any, source_path: Path, dest_path: Path) -> None:
    storage = driver.filesystem_cache.storage(driver._main_id)
    parent = driver.ensure_parent(storage, dest_path.parts)
    with source_path.open("rb") as f:
        driver.put_file(parent, dest_path.parts[-1], f, source_path.stat().st_size)
    source_path.unlink()
the code works on Android device but can't upload files to scribe. Could someone point out why my code doesn't work?

Original code on GitHub: https://github.com/xxyzz/WordDumb/bl...e.py#L276-L284

Last edited by xxyzz; 12-02-2023 at 02:10 AM.
xxyzz is offline   Reply With Quote