No description
Find a file
github-actions[bot] e3b70438d7 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1c79f7f85262067ecdffd95234032dda50f42958?narHash=sha256-DPGw9u0Ejy5Hkip79wWSfC1i8q%2BYqKYngi0AFx3Z4W8%3D' (2024-11-23)
  → 'github:NixOS/nixpkgs/57feb2a16f705eeffb075888d92a986e66473012?narHash=sha256-ndq0dD5E6FkqwmNYFS1wUAHa/5HixS3jLjulogM%2B7/E%3D' (2024-11-30)
2024-12-01 00:26:00 +00:00
.github/workflows auto update flake lock 2024-11-17 11:29:03 -05:00
figures add demo 2024-11-17 13:54:49 -05:00
kindle_fetch make logging a little less verbose 2024-11-17 13:36:34 -05:00
.envrc basic version 2024-06-08 12:23:22 -04:00
.gitignore basic version 2024-06-08 12:23:22 -04:00
flake.lock flake.lock: Update 2024-12-01 00:26:00 +00:00
flake.nix provide exectuable for flake and add readme 2024-06-08 13:24:31 -04:00
poetry.lock polish the help and update the flake and readme 2024-11-07 09:52:47 -05:00
pyproject.toml put the ugly IMAP stuff into its own module 2024-11-17 11:20:53 -05:00
README.md add demo 2024-11-17 13:54:49 -05:00

Kindle (Scribe) Email Fetch Hack

This is a python script (or, more adequately, a bodge) 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.

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

usage: kindle_fetch [-h] [--outdir OUTDIR] [--current_file CURRENT_FILE] [--imap_folder IMAP_FOLDER]
                    [--loglevel LOGLEVEL]
                    server user pass_command

Monitors you email and automatically downloads the kindle PDF notes sent to it.

positional arguments:
  server                the IMAP server to connect to
  user                  the IMAP username
  pass_command          a shell command that returns the password to the server

options:
  -h, --help            show this help message and exit
  --outdir OUTDIR       the kindle note PDFs will be saved into `OUTDIR/[name].pdf` (default: ~/kindle_dump)
  --current_file CURRENT_FILE
                        the latest downloaded file will be copied to `OUTDIR/[current_file] (default:
                        .latest.pdf)
  --imap_folder IMAP_FOLDER
                        the IMAP folder to monitor for new messages (default: INBOX)
  --loglevel LOGLEVEL   the python logging level to use (default: info)