Skip to content

Content Filtering

rhoopr edited this page May 2, 2026 · 13 revisions

Content Filtering

kei provides several ways to control which assets are downloaded.

By Media Type

Flag Effect
--skip-videos Skip standalone video files
--skip-photos Skip image files (download only videos)
--live-photo-mode Control live photo handling: both, image-only, video-only, skip

These can be combined. For example, --skip-photos --live-photo-mode skip downloads only standalone videos.

By Date Range

Flag Effect
--skip-created-before Skip assets older than a date or interval
--skip-created-after Skip assets newer than a date or interval

Both accept ISO 8601 dates (2024-01-01) or relative intervals (30d).

Combine them to download a specific window:

kei sync -u me@email.com -d /photos \
  --skip-created-before 2024-01-01 \
  --skip-created-after 2024-12-31

By Library

By default, syncs run against your personal library (PrimarySync). --library is repeatable in v0.13 and accepts sentinels (primary, shared, all, none), named zones, and !name exclusions in one grammar:

kei sync --library primary --library SharedSync-AB12CD34   # primary plus one named zone
kei sync --library shared                                  # every shared zone, primary excluded
kei sync --library all '!SharedSync-Photos'                # all but one

Use kei list libraries to see what's available.

By Album / Smart Folder / Unfiled

v0.13 splits selection into three orthogonal axes; each is repeatable, accepts sentinels, and accepts inline !name exclusions:

Flag Default Sentinels Picks
--album all all / none User-created albums
--smart-folder none all / all-with-sensitive / none Apple smart folders (Favorites, Hidden, Screenshots, etc.)
--unfiled true true / false Library-wide pass for photos not in any album
# every album except Drafts
kei sync --album '!Drafts'

# only smart-folder Favorites, no album passes, no unfiled
kei sync --album none --smart-folder Favorites --unfiled false

# everything: every album, every smart folder (incl. Hidden / Recently Deleted), unfiled
kei sync --smart-folder all-with-sensitive

--exclude-album is deprecated in v0.13 — use --album '!NAME' instead. The old form still works through v0.20 with a warning.

By Filename Pattern

Use --filename-exclude to skip files matching glob patterns. Patterns are case-insensitive.

kei sync --filename-exclude "*.AAE" --filename-exclude "Screenshot*"

By Recency

Use --recent N to download only the N most recently added photos. This limits API pagination - enumeration stops after N assets are found.

RAW Alignment

Use --align-raw to control how RAW+JPEG pairs are handled. When a photo has both an Original and Alternative version, this policy can swap them so the RAW file becomes the primary download (or vice versa).

Policy Effect
as-is No change (default)
original RAW Alternative becomes the Original
alternative RAW Original becomes the Alternative

The swap is applied before the size lookup, so --size original combined with --align-raw original downloads the RAW file.

Filter Ordering

Selectors and filters are applied in this order:

  1. Selectors (--library, --album, --smart-folder, --unfiled) decide which passes run and which assets each pass enumerates.
  2. Media type filters (--skip-videos, --skip-photos, --live-photo-mode)
  3. Date range filters (--skip-created-before/after)
  4. Filename patterns (--filename-exclude)
  5. Recency limit (--recent)
  6. Existing file check (skip already-downloaded files)

Clone this wiki locally