Repository navigation
nitter-cli v0.6.0
v0.6.0 — 2026-09-13
Added
nitter downloadnaming templates: thefilename_templateconfig key (default{id}-{seq}, byte-identical to the previous behavior) anddirectory_template(default empty = flat) name and place downloaded files via the placeholders{id},{seq},{user},{kind},{ext};--filename-templateoverrides 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 cleargain--state-dir DIR: both subcommands can now operate on awatch --state-dirdirectory instead of only the default~/.nitter-cli/statelocation (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 ascode; the run still exits 1 when a source failed).--jsonwithout--onceremains a usage error (exit 2): the resident loop is a stream of cycles —--ndjsonstays the envelope stream.watch --max-new-overflow keep|drop(defaultdrop, the previous silent-loss behavior):keepleaves tweets beyond the--max-newcap unseen so the next cycles re-emit them under the same cap (宁重勿丢 — a burst larger than twice the cap drains over several cycles);keeptogether with--max-new 0still 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 BOTHusernameandpasswordnow 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 URLoverride 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,downloadandinstances testnow emitnitter.pipeline/v1envelopes when stdout is not a TTY and no explicit--json/--ndjsonis given, sonitter search "..." | nitter downloadworks 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).watchkeeps its text default in pipes (pass--ndjsonfor the envelope stream);config,seenandupdateare unchanged. user --max-pages 0now 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 configmax_pages/ built-in default of 5, andsearch/listkeep 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