2024-06-08 13:24:31 -04:00
|
|
|
# Kindle (Scribe) Email Fetch Hack
|
|
|
|
|
2024-11-17 13:13:32 -05:00
|
|
|
This is a python script (or, more adequately, a
|
|
|
|
[bodge](https://www.youtube.com/watch?v=lIFE7h3m40U)) to log into an
|
|
|
|
IMAP server, monitor incoming messages for the ones that contain the
|
|
|
|
links to the PDFs that you sent from the Kindle scribe. Once such an
|
|
|
|
email is found the PDF linked therein is downloaded to a local
|
|
|
|
directory `OUTDIR/[name].pdf` (see below) and the email is
|
|
|
|
deleted. The latest downloaded file is also copied to a preset
|
|
|
|
filename to make it easier to find it. I'm always running `zathura
|
|
|
|
OUTDIR/.latest.pdf` to have the latest kindle PDF visible.
|
2024-06-08 13:24:31 -04:00
|
|
|
|
2024-11-17 13:54:49 -05:00
|
|
|

|
|
|
|
|
2024-06-08 13:24:31 -04:00
|
|
|
## Installation / Usage
|
|
|
|
|
|
|
|
Either clone this repo and use `poerty install` and the like or run the nix flake with `nix run github:vale981/kindle_fetch -- [args]`.
|
|
|
|
|
|
|
|
```
|
2024-11-17 13:24:33 -05:00
|
|
|
usage: kindle_fetch [-h] [--outdir OUTDIR] [--current_file CURRENT_FILE] [--imap_folder IMAP_FOLDER]
|
|
|
|
[--loglevel LOGLEVEL]
|
|
|
|
server user pass_command
|
2024-06-08 13:24:31 -04:00
|
|
|
|
2024-11-07 09:52:47 -05:00
|
|
|
Monitors you email and automatically downloads the kindle PDF notes sent to it.
|
2024-06-08 13:24:31 -04:00
|
|
|
|
|
|
|
positional arguments:
|
|
|
|
server the IMAP server to connect to
|
|
|
|
user the IMAP username
|
2024-11-17 13:24:33 -05:00
|
|
|
pass_command a shell command that returns the password to the server
|
2024-06-08 13:24:31 -04:00
|
|
|
|
|
|
|
options:
|
|
|
|
-h, --help show this help message and exit
|
2024-11-17 13:24:33 -05:00
|
|
|
--outdir OUTDIR the kindle note PDFs will be saved into `OUTDIR/[name].pdf` (default: ~/kindle_dump)
|
2024-06-08 13:24:31 -04:00
|
|
|
--current_file CURRENT_FILE
|
2024-11-17 13:24:33 -05:00
|
|
|
the latest downloaded file will be copied to `OUTDIR/[current_file] (default:
|
|
|
|
.latest.pdf)
|
2024-06-08 13:24:31 -04:00
|
|
|
--imap_folder IMAP_FOLDER
|
2024-11-17 13:24:33 -05:00
|
|
|
the IMAP folder to monitor for new messages (default: INBOX)
|
|
|
|
--loglevel LOGLEVEL the python logging level to use (default: info)
|
2024-06-08 13:24:31 -04:00
|
|
|
```
|