github neoromantic/telegram-sync-cli v0.16.0

28 minutes ago

Added

  • tg messages list takes --type, --since and --until, so every voice note of a chat, or
    the chat since Monday, is one command instead of tg api messages.search with a hand-built
    peer and filter. --type takes one or more message types, comma-separated or repeated
    (voice, photo, video, document…), plus round and animation for the round video
    messages and GIFs that video also covers; --since and --until take the forms of
    tg messages search. A filtered page reads only the cache, needs no credentials for a chat
    the cache knows (a cached @username included, with allowedChats set too), explains a name
    the cache can't resolve, and pages with --before and --after as before. It adds complete, true only when one cached range covers the page up to the chat's
    newest known message and, with --type, every message in it has its type (a date window never
    guesses the date of a message the cache lacks); missing
    (history, types) says why it is false, missingBefore where the newest gap ends, and
    suggestion one sentence. next of an incomplete page has what fills it
    (tg messages list --fresh, tg db migrate), then the same page again, with --account
    kept; next carries --since and --until resolved to UTC seconds. Without the new flags the
    output is unchanged. tg messages search takes --type too, echoes it in filters.type and
    adds typesPending; its next then finishes a pending migration. Both commands suggest a
    one-time manual fetch for media whose type is unknown. When only the type is missing,
    list omits the automatic next page even if it has enough known matches to fill the limit.

  • tg media download takes several --id values and downloads the files of those messages of
    the chat in one run: up to 100 IDs per fetch, one private-chat protection check, up to 5 files at
    a time (2 of 20 MiB or more) and a flood wait that pauses the whole batch instead of failing
    files. A file fails on waits only after six in a row with no part downloaded between them,
    so a large download throttled by Telegram's speed limit completes. It prints one JSON line per file as each finishes, success or error, and exits 1 when
    any failed. Cached files need no network and partial files resume, as before. One --id
    prints what it printed before; a repeated --id still runs as a batch, downloading the ID once.

  • --out takes a name template such as ./media/{chat}/{date}_{id}_{name} (placeholders
    {chat}, {id}, {date}, {name}, {kind}); each filled part is made a safe file name,
    and one that exists as a symlink fails that file instead of being followed.
    With several --id, a directory --out names files {id}_{name}, so two photos no longer
    collide on photo.jpg. Repeating a batch accepts existing files with identical bytes. A
    collision between different files in one batch returns FILE_EXISTS even with --overwrite.
    Without --overwrite, a new file is published with a hard link; on a filesystem without
    hard links (exFAT, FAT, some network shares) it is copied instead, never over an existing
    file. If the copy is interrupted, use --overwrite to replace a partial export.

  • Transcribe voice and video notes with a local Whisper program using tg media transcribe. Search their transcripts with tg messages search, including snippets and counts.

Fixed

  • tg messages search --since and --until with milliseconds round up to the next second,
    since message dates are whole seconds: --until 00:01:40.500Z no longer leaves out a message
    sent at 00:01:40, and --since with milliseconds no longer takes one sent just before it.
    Its next carries the bounds resolved to UTC, so a relative bound (60s) keeps its window
    across pages.
  • With allowedChats set, tg messages search resolves its chat and the list from the cache
    alone, so a cached @username without an access hash needs no credentials again.
  • tg messages search --fresh is INVALID_ARGS that says search reads only the cache, instead
    of a generic unknown option.
  • A string flag's value that looks like a repeatable flag is no longer read as that flag: tg send --caption '--file=x' sends that caption.
  • A cached page of history vouches for the IDs above its newest message only up to the chat's
    newest message known before the request: a fetch that Telegram answers with nothing new now
    settles the gap (tg messages list --before 21 --fresh below a known message 30, a chat
    Telegram shows empty, or a chat whose newest messages were deleted), and a message cached while
    the request ran no longer vouches for a page that could miss a message sent meanwhile. The
    daemon's history pages follow the same rule.

Don't miss a new telegram-sync-cli release

NewReleases is sending notifications on new releases.