Skip to content

nitter-cli v0.6.0

Choose a tag to compare

@github-actions github-actions released this 13 Sep 11:14
· 197 commits to main since this release

v0.6.0 — 2026-09-13

Added

  • nitter download naming templates: the filename_template config key (default {id}-{seq}, byte-identical to the previous behavior) and directory_template (default empty = flat) name and place downloaded files via the placeholders {id}, {seq}, {user}, {kind}, {ext}; --filename-template overrides the filename template per invocation. Covers always land as <id>-cover.<ext> (the template governs regular files only), rendered names are sanitized (Windows-illegal characters become _), a rendered-name collision within one ref gets a -2, -3, … suffix, and an invalid template warns once on stderr and falls back to the default/flat instead of failing (pixiv semantics). The config command now manages twelve scalar keys.
  • seen list/seen clear gain --state-dir DIR: both subcommands can now operate on a watch --state-dir directory instead of only the default ~/.nitter-cli/state location (the documented asymmetry is gone; reads and clears create nothing — a missing directory is simply the empty store).
  • watch --once --json: prints one JSON document {"tweets":[...bare Tweet objects...],"errors":[{"ref","code","message"}...]} for the single cycle — selected tweets plus one entry per failed source (SDK error kind as code; the run still exits 1 when a source failed). --json without --once remains a usage error (exit 2): the resident loop is a stream of cycles — --ndjson stays the envelope stream.
  • watch --max-new-overflow keep|drop (default drop, the previous silent-loss behavior): keep leaves tweets beyond the --max-new cap unseen so the next cycles re-emit them under the same cap (宁重勿丢 — a burst larger than twice the cap drains over several cycles); keep together with --max-new 0 still seals the current first page as the baseline. Any other value is a usage error (exit 2).

Changed

  • Instance basic authentication: an [[instances]] entry with BOTH username and password now authenticates requests to that instance (HTTP basic auth, host-scoped inside the transport). Credentials can only ever ride requests addressed to their own instance — the third-party media endpoints never see them — and they never enter errors, logs, or responses; an incomplete pair is treated as unconfigured. A one-off --instance URL override is a plain URL and carries no credentials (documented limitation).
  • Data commands default to NDJSON when stdout is a pipe: user, search, list, get, media, download and instances test now emit nitter.pipeline/v1 envelopes when stdout is not a TTY and no explicit --json/--ndjson is given, so nitter search "..." | nitter download works without flags. Explicit flags win; on a TTY the default stays the human table; an empty result in a pipe prints nothing (no (empty) hint). watch keeps its text default in pipes (pass --ndjson for the envelope stream); config, seen and update are unchanged.
  • user --max-pages 0 now means UNBOUNDED HTML pagination: the HTML fallback follows the load-more cursor chain until upstream exhaustion (runaway runs are bounded by context cancellation); the RSS feed is single-page and unaffected. The omitted flag still applies the config max_pages / built-in default of 5, and search/list keep the old "0 = default" semantics.

Deprecated

Removed

Fixed

Security


v0.6.0 — 2026-09-13

新增

  • nitter download 命名模板:filename_template 配置键(默认 {id}-{seq},与既有行为逐字节一致)与 directory_template(默认空 = 平铺)通过占位符 {id}、{seq}、{user}、{kind}、{ext} 命名并放置下载文件;--filename-template 单次覆盖文件名模板。封面始终落盘为 <id>-cover.<ext>(模板只作用于普通文件),渲染名做安全清洗(Windows 非法字符替换为 _),同一 ref 内的渲染名碰撞获得 -2、-3… 后缀,非法模板以一条 stderr 警告回退默认/平铺而不使运行失败(pixiv 语义)。config 命令现在管理十二个标量键。
  • seen list/seen clear 新增 --state-dir DIR:两个子命令现在可以作用于 watch --state-dir 的目录,而不只是默认的 ~/.nitter-cli/state(原先记录的不对称已消除;读取与清除不创建任何东西——不存在的目录就是空库)。
  • watch --once --json:为单轮打印一个 JSON 文档 {"tweets":[...裸 Tweet 对象...],"errors":[{"ref","code","message"}...]}——选出的推文外加每个失败源一条记录(code 为 SDK 错误 Kind;有源失败仍退出 1)。不带 --once 的 --json 仍是用法错误(退出 2):常驻循环是逐轮的流——信封流仍用 --ndjson。
  • watch --max-new-overflow keep|drop(默认 drop,即此前的静默丢失行为):keep 让超出 --max-new 上限的新推文保持未标记,由后续各轮在同一上限下重新推送(宁重勿丢——突发量超过两倍上限时需多轮才能排空);keep 搭配 --max-new 0 仍将当前首页封存为新基准。其他取值是用法错误(退出 2)。

变更

  • 实例 basic 认证:[[instances]] 条目同时设置 username 与 password 时,发往该实例的请求现在会携带 HTTP basic 认证(在传输层内按主机限定)。凭证只会附着在发往其所属实例的请求上——第三方媒体端点永远看不到它——也不会进入错误、日志或响应;只设置一半的凭证对视为未配置。单次的 --instance URL 覆盖是纯 URL,不携带凭证(已记录的局限)。
  • 数据命令在 stdout 为管道时默认输出 NDJSON:user、search、list、get、media、download 与 instances test 在 stdout 非 TTY 且未显式给出 --json/--ndjson 时,现在输出 nitter.pipeline/v1 信封,nitter search "..." | nitter download 无需任何 flag 即可直连。显式 flag 永远优先;TTY 下默认仍是人类表格;管道下的空结果完全静默(无 (empty) 提示)。watch 在管道下保持文本默认(信封流请传 --ndjson);config、seen、update 不变。
  • user --max-pages 0 现在表示不限页:HTML 回退路径一直跟随 load-more 游标翻页,直至上游穷尽(失控运行由上下文取消兜底);RSS 源天然单页,不受影响。不传 flag 仍应用配置 max_pages / 内置默认 5,search/list 保持旧的「0 = 用默认值」语义。

弃用

移除

修复

安全

Full Changelog: v0.5.0...v0.6.0