sync: update from private repo (c764df2f)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-29 01:32:25 +00:00
parent b857c33ef6
commit a6d1879d63
75 changed files with 3874 additions and 334 deletions
+30 -1
View File
@@ -4,7 +4,8 @@ twitter-cli を内部で呼び出して X (旧 Twitter) のデータを取得す
## 認証設定(必須)
twitter-cli を動かすには Cookie 認証が必要。Settings UI の "Tools" セクションで設定:
X ツールは `tools.x_cli_command` で指定した外部 CLI を呼び出す。どちらの CLI でも
Cookie 認証が必要。Settings UI の "Tools" セクションで設定:
- **X Auth Token**: ブラウザの `auth_token` cookie の値
- **X ct0**: ブラウザの `ct0` cookie の値
@@ -14,6 +15,34 @@ twitter-cli を動かすには Cookie 認証が必要。Settings UI の "Tools"
設定が無いと「認証エラー」で失敗する。
## バックエンド CLIx-adapter / twitter-cli
2026 年に X.com が Web クライアントを新バンドル(x-web / `sign.o*.js`)へ移行し、
従来の twitter-cli が依存する `x_client_transaction` の transaction-id 生成が壊れた
`Failed to init ClientTransaction` → 全リクエストが HTTP 404 → `exited with code 1`)。
復旧のため、新バンドルに追従している **twscrape**transaction-id 生成 `XClIdGen` +
検索/ユーザー投稿/詳細)と **twikit**(ホームタイムラインの GraphQL endpoint 定義)を
使う twitter-cli 互換アダプタ `x-adapter` を導入した。x.ts は無改修で、`x_cli_command`
を切り替えるだけ。
セットアップ:
```bash
./scripts/install-x-adapter.sh # 隔離 venv に twscrape/twikit を入れ ~/.local/bin/x-adapter を作る
# config.yaml:
# tools:
# x_cli_command: [x-adapter]
```
X が再び取得を壊した場合(おおむね 2〜4 週ごと)の修復レバー:
```bash
./scripts/install-x-adapter.sh --upgrade # twscrape / twikit を最新へ
```
`x-adapter` のサブコマンドは twitter-cli と同じ(`search` / `user-posts` / `tweet` /
`feed`)で、同じ YAML を stdout に吐く。実装は `scripts/x-adapter/x_adapter.py`
pure マッピング関数の単体テストは `scripts/x-adapter/test_x_adapter.py`
## XSearch — 投稿検索
```js