twitter-cli 0.8.2__tar.gz → 0.8.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/PKG-INFO +30 -26
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/README.md +29 -25
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/pyproject.toml +1 -1
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/fixtures/home_timeline.json +7 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_auth.py +1 -1
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_parser_fixtures.py +3 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/auth.py +1 -1
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/cli.py +0 -130
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/formatter.py +1 -1
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/parser.py +4 -1
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/.github/workflows/ci.yml +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/.github/workflows/publish-clawhub.yml +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/.github/workflows/publish.yml +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/.gitignore +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/LICENSE +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/SCHEMA.md +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/SKILL.md +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/config.yaml +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/conftest.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/fixtures/followers_page.json +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/fixtures/list_timeline.json +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/fixtures/search_timeline.json +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/fixtures/tweet_detail.json +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_cli.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_client.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_config.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_config_normalization.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_filter.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_search.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_serialization.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/tests/test_smoke.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/__init__.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/cache.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/client.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/config.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/constants.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/exceptions.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/filter.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/graphql.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/models.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/output.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/search.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/serialization.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/twitter_cli/timeutil.py +0 -0
- {twitter_cli-0.8.2 → twitter_cli-0.8.3}/uv.lock +0 -0
|
@@ -70,7 +70,7 @@ body:
|
|
|
70
70
|
id: diagnostics
|
|
71
71
|
attributes:
|
|
72
72
|
label: Diagnostics
|
|
73
|
-
description: "Paste the output of `twitter
|
|
73
|
+
description: "Paste the output of `twitter -v <command>` here. This helps us diagnose cookie and auth issues quickly."
|
|
74
74
|
render: text
|
|
75
75
|
- type: textarea
|
|
76
76
|
id: logs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: twitter-cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3
|
|
4
4
|
Summary: A CLI for Twitter/X — feed, bookmarks, and user timeline in terminal
|
|
5
5
|
Project-URL: Homepage, https://github.com/jackwener/twitter-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/jackwener/twitter-cli
|
|
@@ -324,7 +324,7 @@ Mode behavior:
|
|
|
324
324
|
- `Invalid tweet JSON file`
|
|
325
325
|
- Regenerate input using `twitter feed --json > tweets.json`.
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
|
|
328
328
|
|
|
329
329
|
Structured error codes commonly include `not_authenticated`, `not_found`, `invalid_input`, `rate_limited`, and `api_error`.
|
|
330
330
|
|
|
@@ -365,27 +365,28 @@ twitter_cli/
|
|
|
365
365
|
|
|
366
366
|
twitter-cli ships with a [`SKILL.md`](./SKILL.md) so AI agents can execute common X/Twitter workflows.
|
|
367
367
|
|
|
368
|
-
####
|
|
368
|
+
#### [Skills CLI](https://github.com/vercel-labs/skills) (Recommended)
|
|
369
369
|
|
|
370
370
|
```bash
|
|
371
|
-
|
|
372
|
-
mkdir -p .agents/skills
|
|
373
|
-
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
374
|
-
|
|
375
|
-
# Or copy SKILL.md only
|
|
376
|
-
curl -o .agents/skills/twitter-cli/SKILL.md \
|
|
377
|
-
https://raw.githubusercontent.com/jackwener/twitter-cli/main/SKILL.md
|
|
371
|
+
npx skills add jackwener/twitter-cli
|
|
378
372
|
```
|
|
379
373
|
|
|
380
|
-
|
|
374
|
+
| Flag | Description |
|
|
375
|
+
| --- | --- |
|
|
376
|
+
| `-g` | Install globally (user-level, shared across projects) |
|
|
377
|
+
| `-a claude-code` | Target a specific agent |
|
|
378
|
+
| `-y` | Non-interactive mode |
|
|
381
379
|
|
|
382
|
-
|
|
380
|
+
#### Manual Install
|
|
383
381
|
|
|
384
382
|
```bash
|
|
385
|
-
|
|
383
|
+
mkdir -p .agents/skills
|
|
384
|
+
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
386
385
|
```
|
|
387
386
|
|
|
388
|
-
|
|
387
|
+
#### ~~OpenClaw / ClawHub~~ (Deprecated)
|
|
388
|
+
|
|
389
|
+
> ⚠️ ClawHub install method is deprecated and no longer supported. Use [Skills CLI](#skills-cli-recommended) or Manual Install above.
|
|
389
390
|
|
|
390
391
|
## 中文
|
|
391
392
|
|
|
@@ -572,7 +573,7 @@ score = likes_w * likes
|
|
|
572
573
|
- 或在弹出 Keychain 授权时点击 **"始终允许"**。
|
|
573
574
|
- 报错 `Twitter API error 404`:通常是 queryId 轮换,重试即可。
|
|
574
575
|
|
|
575
|
-
|
|
576
|
+
|
|
576
577
|
|
|
577
578
|
- 结构化错误码通常会区分 `not_authenticated`、`not_found`、`invalid_input`、`rate_limited`、`api_error`。
|
|
578
579
|
|
|
@@ -596,26 +597,29 @@ score = likes_w * likes
|
|
|
596
597
|
|
|
597
598
|
twitter-cli 提供了 [`SKILL.md`](./SKILL.md),可让 AI Agent 更稳定地调用本工具。
|
|
598
599
|
|
|
599
|
-
####
|
|
600
|
+
#### [Skills CLI](https://github.com/vercel-labs/skills)(推荐)
|
|
600
601
|
|
|
601
602
|
```bash
|
|
602
|
-
|
|
603
|
-
mkdir -p .agents/skills
|
|
604
|
-
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
605
|
-
|
|
606
|
-
# 或仅下载 SKILL.md
|
|
607
|
-
curl -o .agents/skills/twitter-cli/SKILL.md \
|
|
608
|
-
https://raw.githubusercontent.com/jackwener/twitter-cli/main/SKILL.md
|
|
603
|
+
npx skills add jackwener/twitter-cli
|
|
609
604
|
```
|
|
610
605
|
|
|
611
|
-
|
|
606
|
+
| 参数 | 说明 |
|
|
607
|
+
| --- | --- |
|
|
608
|
+
| `-g` | 全局安装(用户级别,跨项目共享) |
|
|
609
|
+
| `-a claude-code` | 指定目标 Agent |
|
|
610
|
+
| `-y` | 非交互模式 |
|
|
612
611
|
|
|
613
|
-
|
|
612
|
+
#### 手动安装
|
|
614
613
|
|
|
615
614
|
```bash
|
|
616
|
-
|
|
615
|
+
mkdir -p .agents/skills
|
|
616
|
+
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
617
617
|
```
|
|
618
618
|
|
|
619
|
+
#### ~~OpenClaw / ClawHub~~(已过时)
|
|
620
|
+
|
|
621
|
+
> ⚠️ ClawHub 安装方式已过时,不再支持。请使用上方的 Skills CLI 或手动安装。
|
|
622
|
+
|
|
619
623
|
### 更多工具
|
|
620
624
|
|
|
621
625
|
- [bilibili-cli](https://github.com/jackwener/bilibili-cli) — Bilibili 视频、用户、搜索与动态 CLI
|
|
@@ -292,7 +292,7 @@ Mode behavior:
|
|
|
292
292
|
- `Invalid tweet JSON file`
|
|
293
293
|
- Regenerate input using `twitter feed --json > tweets.json`.
|
|
294
294
|
|
|
295
|
-
|
|
295
|
+
|
|
296
296
|
|
|
297
297
|
Structured error codes commonly include `not_authenticated`, `not_found`, `invalid_input`, `rate_limited`, and `api_error`.
|
|
298
298
|
|
|
@@ -333,27 +333,28 @@ twitter_cli/
|
|
|
333
333
|
|
|
334
334
|
twitter-cli ships with a [`SKILL.md`](./SKILL.md) so AI agents can execute common X/Twitter workflows.
|
|
335
335
|
|
|
336
|
-
####
|
|
336
|
+
#### [Skills CLI](https://github.com/vercel-labs/skills) (Recommended)
|
|
337
337
|
|
|
338
338
|
```bash
|
|
339
|
-
|
|
340
|
-
mkdir -p .agents/skills
|
|
341
|
-
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
342
|
-
|
|
343
|
-
# Or copy SKILL.md only
|
|
344
|
-
curl -o .agents/skills/twitter-cli/SKILL.md \
|
|
345
|
-
https://raw.githubusercontent.com/jackwener/twitter-cli/main/SKILL.md
|
|
339
|
+
npx skills add jackwener/twitter-cli
|
|
346
340
|
```
|
|
347
341
|
|
|
348
|
-
|
|
342
|
+
| Flag | Description |
|
|
343
|
+
| --- | --- |
|
|
344
|
+
| `-g` | Install globally (user-level, shared across projects) |
|
|
345
|
+
| `-a claude-code` | Target a specific agent |
|
|
346
|
+
| `-y` | Non-interactive mode |
|
|
349
347
|
|
|
350
|
-
|
|
348
|
+
#### Manual Install
|
|
351
349
|
|
|
352
350
|
```bash
|
|
353
|
-
|
|
351
|
+
mkdir -p .agents/skills
|
|
352
|
+
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
354
353
|
```
|
|
355
354
|
|
|
356
|
-
|
|
355
|
+
#### ~~OpenClaw / ClawHub~~ (Deprecated)
|
|
356
|
+
|
|
357
|
+
> ⚠️ ClawHub install method is deprecated and no longer supported. Use [Skills CLI](#skills-cli-recommended) or Manual Install above.
|
|
357
358
|
|
|
358
359
|
## 中文
|
|
359
360
|
|
|
@@ -540,7 +541,7 @@ score = likes_w * likes
|
|
|
540
541
|
- 或在弹出 Keychain 授权时点击 **"始终允许"**。
|
|
541
542
|
- 报错 `Twitter API error 404`:通常是 queryId 轮换,重试即可。
|
|
542
543
|
|
|
543
|
-
|
|
544
|
+
|
|
544
545
|
|
|
545
546
|
- 结构化错误码通常会区分 `not_authenticated`、`not_found`、`invalid_input`、`rate_limited`、`api_error`。
|
|
546
547
|
|
|
@@ -564,26 +565,29 @@ score = likes_w * likes
|
|
|
564
565
|
|
|
565
566
|
twitter-cli 提供了 [`SKILL.md`](./SKILL.md),可让 AI Agent 更稳定地调用本工具。
|
|
566
567
|
|
|
567
|
-
####
|
|
568
|
+
#### [Skills CLI](https://github.com/vercel-labs/skills)(推荐)
|
|
568
569
|
|
|
569
570
|
```bash
|
|
570
|
-
|
|
571
|
-
mkdir -p .agents/skills
|
|
572
|
-
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
573
|
-
|
|
574
|
-
# 或仅下载 SKILL.md
|
|
575
|
-
curl -o .agents/skills/twitter-cli/SKILL.md \
|
|
576
|
-
https://raw.githubusercontent.com/jackwener/twitter-cli/main/SKILL.md
|
|
571
|
+
npx skills add jackwener/twitter-cli
|
|
577
572
|
```
|
|
578
573
|
|
|
579
|
-
|
|
574
|
+
| 参数 | 说明 |
|
|
575
|
+
| --- | --- |
|
|
576
|
+
| `-g` | 全局安装(用户级别,跨项目共享) |
|
|
577
|
+
| `-a claude-code` | 指定目标 Agent |
|
|
578
|
+
| `-y` | 非交互模式 |
|
|
580
579
|
|
|
581
|
-
|
|
580
|
+
#### 手动安装
|
|
582
581
|
|
|
583
582
|
```bash
|
|
584
|
-
|
|
583
|
+
mkdir -p .agents/skills
|
|
584
|
+
git clone git@github.com:jackwener/twitter-cli.git .agents/skills/twitter-cli
|
|
585
585
|
```
|
|
586
586
|
|
|
587
|
+
#### ~~OpenClaw / ClawHub~~(已过时)
|
|
588
|
+
|
|
589
|
+
> ⚠️ ClawHub 安装方式已过时,不再支持。请使用上方的 Skills CLI 或手动安装。
|
|
590
|
+
|
|
587
591
|
### 更多工具
|
|
588
592
|
|
|
589
593
|
- [bilibili-cli](https://github.com/jackwener/bilibili-cli) — Bilibili 视频、用户、搜索与动态 CLI
|
|
@@ -61,6 +61,13 @@
|
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
+
"note_tweet": {
|
|
65
|
+
"note_tweet_results": {
|
|
66
|
+
"result": {
|
|
67
|
+
"text": "Hello\nworld\n\nThis is the full text of a long tweet that goes beyond the 280 character limit and contains additional content that would be hidden behind Show More in the Twitter UI."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
64
71
|
"views": {
|
|
65
72
|
"count": "1234"
|
|
66
73
|
}
|
|
@@ -373,7 +373,7 @@ def test_get_cookies_includes_keychain_hint_in_error(monkeypatch) -> None:
|
|
|
373
373
|
|
|
374
374
|
msg = str(exc_info.value)
|
|
375
375
|
assert "security unlock-keychain" in msg
|
|
376
|
-
assert "twitter
|
|
376
|
+
assert "twitter -v" in msg
|
|
377
377
|
|
|
378
378
|
|
|
379
379
|
def test_extract_in_process_returns_diagnostics_on_failure(monkeypatch) -> None:
|
|
@@ -26,6 +26,9 @@ def test_parse_home_timeline_fixture(fixture_loader) -> None:
|
|
|
26
26
|
assert [tweet.id for tweet in tweets] == ["1", "20"]
|
|
27
27
|
assert cursor == "cursor-bottom-1"
|
|
28
28
|
assert tweets[0].media[0].type == "photo"
|
|
29
|
+
# note_tweet full text should be preferred over legacy.full_text for long tweets
|
|
30
|
+
assert "Show More" in tweets[0].text
|
|
31
|
+
assert tweets[0].text.startswith("Hello\nworld\n")
|
|
29
32
|
assert tweets[0].urls == ["https://example.com/post"]
|
|
30
33
|
assert tweets[1].is_retweet is True
|
|
31
34
|
assert tweets[1].retweeted_by == "bob"
|
|
@@ -584,7 +584,7 @@ def get_cookies() -> Dict[str, str]:
|
|
|
584
584
|
lines.append("Option 1: Set TWITTER_AUTH_TOKEN and TWITTER_CT0 environment variables")
|
|
585
585
|
lines.append("Option 2: Make sure you are logged into x.com in your browser (Arc/Chrome/Edge/Firefox/Brave)")
|
|
586
586
|
lines.append("")
|
|
587
|
-
lines.append("Run 'twitter
|
|
587
|
+
lines.append("Run 'twitter -v <command>' for debug diagnostics.")
|
|
588
588
|
raise RuntimeError("\n".join(lines))
|
|
589
589
|
|
|
590
590
|
# Verify only for explicit auth failures; transient endpoint issues are tolerated.
|
|
@@ -31,7 +31,6 @@ Write commands:
|
|
|
31
31
|
from __future__ import annotations
|
|
32
32
|
|
|
33
33
|
import logging
|
|
34
|
-
import os
|
|
35
34
|
import re
|
|
36
35
|
import inspect
|
|
37
36
|
import sys
|
|
@@ -1230,135 +1229,6 @@ def unbookmark(tweet_id, as_json, as_yaml):
|
|
|
1230
1229
|
_write_action("🔖", "Removing bookmark", "unbookmark_tweet", tweet_id, as_json=as_json, as_yaml=as_yaml)
|
|
1231
1230
|
|
|
1232
1231
|
|
|
1233
|
-
@cli.command(name="doctor")
|
|
1234
|
-
@structured_output_options
|
|
1235
|
-
def doctor(as_json, as_yaml):
|
|
1236
|
-
# type: (bool, bool) -> None
|
|
1237
|
-
"""Run diagnostics for cookie extraction and authentication.
|
|
1238
|
-
|
|
1239
|
-
Useful for troubleshooting auth issues and for pasting into bug reports.
|
|
1240
|
-
"""
|
|
1241
|
-
import platform
|
|
1242
|
-
|
|
1243
|
-
from .auth import (
|
|
1244
|
-
_diagnose_keychain_issues,
|
|
1245
|
-
_extract_in_process,
|
|
1246
|
-
_extract_via_subprocess,
|
|
1247
|
-
load_from_env,
|
|
1248
|
-
verify_cookies,
|
|
1249
|
-
)
|
|
1250
|
-
|
|
1251
|
-
info: Dict[str, Any] = {}
|
|
1252
|
-
mode = _structured_mode(as_json=as_json, as_yaml=as_yaml)
|
|
1253
|
-
|
|
1254
|
-
# -- System info --
|
|
1255
|
-
info["version"] = __version__
|
|
1256
|
-
info["python"] = sys.version.split()[0]
|
|
1257
|
-
info["platform"] = platform.platform()
|
|
1258
|
-
info["os"] = sys.platform
|
|
1259
|
-
|
|
1260
|
-
# -- Environment --
|
|
1261
|
-
is_ssh = bool(
|
|
1262
|
-
os.environ.get("SSH_CLIENT")
|
|
1263
|
-
or os.environ.get("SSH_TTY")
|
|
1264
|
-
or os.environ.get("SSH_CONNECTION")
|
|
1265
|
-
)
|
|
1266
|
-
info["ssh_session"] = is_ssh
|
|
1267
|
-
info["env_auth_token_set"] = bool(os.environ.get("TWITTER_AUTH_TOKEN"))
|
|
1268
|
-
info["env_ct0_set"] = bool(os.environ.get("TWITTER_CT0"))
|
|
1269
|
-
info["chrome_profile_override"] = os.environ.get("TWITTER_CHROME_PROFILE", "")
|
|
1270
|
-
|
|
1271
|
-
# -- Cookie extraction --
|
|
1272
|
-
env_cookies = load_from_env()
|
|
1273
|
-
info["env_cookies"] = "found" if env_cookies else "not set"
|
|
1274
|
-
|
|
1275
|
-
# In-process extraction
|
|
1276
|
-
in_proc_cookies, in_proc_diag = _extract_in_process()
|
|
1277
|
-
info["in_process"] = {
|
|
1278
|
-
"status": "ok" if in_proc_cookies else "failed",
|
|
1279
|
-
"diagnostics": in_proc_diag,
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
# Subprocess extraction
|
|
1283
|
-
sub_cookies, sub_diag = _extract_via_subprocess()
|
|
1284
|
-
info["subprocess"] = {
|
|
1285
|
-
"status": "ok" if sub_cookies else "failed",
|
|
1286
|
-
"diagnostics": sub_diag,
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
# Combined diagnostics
|
|
1290
|
-
all_diag = in_proc_diag + sub_diag
|
|
1291
|
-
cookies = in_proc_cookies or sub_cookies or env_cookies
|
|
1292
|
-
|
|
1293
|
-
# Keychain hint
|
|
1294
|
-
hint = _diagnose_keychain_issues(all_diag)
|
|
1295
|
-
if hint:
|
|
1296
|
-
info["keychain_hint"] = hint
|
|
1297
|
-
|
|
1298
|
-
# Verification
|
|
1299
|
-
if cookies:
|
|
1300
|
-
try:
|
|
1301
|
-
result = verify_cookies(
|
|
1302
|
-
cookies["auth_token"],
|
|
1303
|
-
cookies["ct0"],
|
|
1304
|
-
cookies.get("cookie_string"),
|
|
1305
|
-
)
|
|
1306
|
-
info["verification"] = "ok"
|
|
1307
|
-
info["screen_name"] = result.get("screen_name", "")
|
|
1308
|
-
except RuntimeError as exc:
|
|
1309
|
-
info["verification"] = "failed: %s" % exc
|
|
1310
|
-
else:
|
|
1311
|
-
info["verification"] = "skipped (no cookies)"
|
|
1312
|
-
|
|
1313
|
-
# -- Output --
|
|
1314
|
-
if _emit_mode_payload(info, mode):
|
|
1315
|
-
return
|
|
1316
|
-
|
|
1317
|
-
console.print("\n🩺 [bold]twitter-cli doctor[/bold]\n")
|
|
1318
|
-
console.print(" Version: %s" % info["version"])
|
|
1319
|
-
console.print(" Python: %s" % info["python"])
|
|
1320
|
-
console.print(" Platform: %s" % info["platform"])
|
|
1321
|
-
console.print(" SSH session: %s" % ("yes ⚠️" if is_ssh else "no"))
|
|
1322
|
-
console.print()
|
|
1323
|
-
|
|
1324
|
-
console.print("[bold]Environment:[/bold]")
|
|
1325
|
-
console.print(" TWITTER_AUTH_TOKEN: %s" % ("set ✅" if info["env_auth_token_set"] else "not set"))
|
|
1326
|
-
console.print(" TWITTER_CT0: %s" % ("set ✅" if info["env_ct0_set"] else "not set"))
|
|
1327
|
-
if info["chrome_profile_override"]:
|
|
1328
|
-
console.print(" TWITTER_CHROME_PROFILE: %s" % info["chrome_profile_override"])
|
|
1329
|
-
console.print()
|
|
1330
|
-
|
|
1331
|
-
console.print("[bold]Cookie Extraction:[/bold]")
|
|
1332
|
-
in_status = info["in_process"]["status"]
|
|
1333
|
-
console.print(
|
|
1334
|
-
" In-process: %s" % ("[green]ok ✅[/green]" if in_status == "ok" else "[red]failed ❌[/red]")
|
|
1335
|
-
)
|
|
1336
|
-
for d in info["in_process"]["diagnostics"]:
|
|
1337
|
-
console.print(" [dim]• %s[/dim]" % d)
|
|
1338
|
-
|
|
1339
|
-
sub_status = info["subprocess"]["status"]
|
|
1340
|
-
console.print(
|
|
1341
|
-
" Subprocess: %s" % ("[green]ok ✅[/green]" if sub_status == "ok" else "[red]failed ❌[/red]")
|
|
1342
|
-
)
|
|
1343
|
-
for d in info["subprocess"]["diagnostics"]:
|
|
1344
|
-
console.print(" [dim]• %s[/dim]" % d)
|
|
1345
|
-
console.print()
|
|
1346
|
-
|
|
1347
|
-
if hint:
|
|
1348
|
-
console.print("[yellow]💡 Hint:[/yellow]")
|
|
1349
|
-
for line in hint.splitlines():
|
|
1350
|
-
console.print(" [yellow]%s[/yellow]" % line)
|
|
1351
|
-
console.print()
|
|
1352
|
-
|
|
1353
|
-
v = info["verification"]
|
|
1354
|
-
if v == "ok":
|
|
1355
|
-
screen = info.get("screen_name", "")
|
|
1356
|
-
console.print("[green]✅ Authentication: OK[/green]%s" % (" (@%s)" % screen if screen else ""))
|
|
1357
|
-
elif v.startswith("failed"):
|
|
1358
|
-
console.print("[red]❌ Authentication: %s[/red]" % v)
|
|
1359
|
-
else:
|
|
1360
|
-
console.print("[yellow]⚠️ Authentication: %s[/yellow]" % v)
|
|
1361
|
-
console.print()
|
|
1362
1232
|
|
|
1363
1233
|
|
|
1364
1234
|
if __name__ == "__main__":
|
|
@@ -128,7 +128,7 @@ def print_tweet_detail(tweet: Tweet, console: Optional[Console] = None) -> None:
|
|
|
128
128
|
qt = tweet.quoted_tweet
|
|
129
129
|
body_parts.append("")
|
|
130
130
|
body_parts.append("┌── Quoted @%s ──" % qt.author.screen_name)
|
|
131
|
-
body_parts.append(qt.text
|
|
131
|
+
body_parts.append(qt.text)
|
|
132
132
|
|
|
133
133
|
body_parts.append("")
|
|
134
134
|
body_parts.append(
|
|
@@ -246,9 +246,12 @@ def parse_tweet_result(result, depth=0):
|
|
|
246
246
|
if is_retweet:
|
|
247
247
|
retweeted_by = user_core.get("screen_name") or user_legacy.get("screen_name", "unknown")
|
|
248
248
|
|
|
249
|
+
# Prefer note_tweet full text for long tweets ("Show More")
|
|
250
|
+
note_text = _deep_get(actual_data, "note_tweet", "note_tweet_results", "result", "text")
|
|
251
|
+
|
|
249
252
|
return Tweet(
|
|
250
253
|
id=actual_data.get("rest_id", ""),
|
|
251
|
-
text=actual_legacy.get("full_text", ""),
|
|
254
|
+
text=note_text or actual_legacy.get("full_text", ""),
|
|
252
255
|
author=author,
|
|
253
256
|
metrics=Metrics(
|
|
254
257
|
likes=_parse_int(actual_legacy.get("favorite_count"), 0),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|