Rednote platform CLI
Project description
rednote-cli
Rednote 平台专用 CLI(独立安装、独立升级、独立发布)。
系统要求
- Python
3.12.x pipx
安装
brew update
brew upgrade python@3.12 pipx
python3.12 --version
pipx --version
pipx ensurepath
exec zsh
pipx install --python python3.12 rednote-cli
升级
pipx upgrade --python python3.12 rednote-cli
如果历史环境用了其他 Python(例如 3.14),先重建:
pipx reinstall --python python3.12 rednote-cli
卸载
pipx uninstall rednote-cli
快速开始
rednote-cli init runtime
rednote-cli doctor run --format json
rednote-cli account login
rednote-cli account status --format json
rednote-cli search note --keyword 旅行 --size 10 --sort-by latest --note-type image_text --format json
常用命令
rednote-cli search note --keyword <kw> [--size N] [--sort-by <comprehensive|latest|most_liked|most_commented|most_favorited>] [--note-type <all|video|image_text>] [--publish-time <all|day|week|half_year>] [--search-scope <all|viewed|unviewed|following>] [--location <all|local|nearby>] [--account <user_id>] [--input <file|->]
rednote-cli note --note-id <id> [--xsec-token t] [--xsec-source src] [--comment-size N] [--sub-comment-size N] [--account <user_id>] [--input <file|->]
# 如上游已拿到 xsec_token,默认优先携带;发现页里的笔记=pc_feed,搜索页里的笔记=pc_search,达人收藏页里的笔记=pc_collect,达人点赞页里的笔记=pc_like,达人笔记页里的笔记=pc_user
rednote-cli search user --keyword <kw> [--size N] [--account <user_id>] [--input <file|->]
rednote-cli user --user-id <id> [--xsec-token t] [--xsec-source src] [--account <user_id>] [--input <file|->]
# 如上游已拿到 xsec_token,默认优先携带;发现页里的达人=pc_feed,搜索页里的达人=pc_search,达人收藏页里的达人=pc_collect,达人点赞页里的达人=pc_like,笔记页里的达人=pc_note
rednote-cli user self --account <user_id>
rednote-cli publish --target image --account <account_uid> [--image-list csv] [--title t] [--content c] [--tags csv] [--schedule-at rfc3339] [--input <file|->]
rednote-cli publish --target video --account <account_uid> [--video <path-or-url>] [--title t] [--content c] [--tags csv] [--schedule-at rfc3339] [--input <file|->]
JSON 输入模式(--input)
参数优先级固定:
- 显式 CLI 参数 >
--inputJSON > 默认值
支持 --input 的命令:
search notesearch usernoteuserpublish
note 的 --input 里如果带 xsec_source,它表示笔记来源:发现页笔记=pc_feed,搜索页笔记=pc_search,达人收藏页笔记=pc_collect,达人点赞页笔记=pc_like,达人笔记页笔记=pc_user。
user 的 --input 里如果带 xsec_source,它表示达人来源:发现页达人=pc_feed,搜索页达人=pc_search,达人收藏页达人=pc_collect,达人点赞页达人=pc_like,笔记页达人=pc_note。
不支持 --input 的命令:
init runtimedoctor runaccount login|status|list|activate|deactivate|deleteuser self
推荐 Agent 调用模板:
rednote-cli --format json --trace-id req-001 search note --input payload.json
cat payload.json | rednote-cli --format json --trace-id req-002 publish --input - --account user_001
输出与退出码
- 建议自动化调用统一使用
--format json+--trace-id - 退出码:
0成功,2参数错误,3认证错误,4风控/限流,5内部错误,6超时,7依赖缺失/未实现
工作区文档
- Workspace 总览:
../../README.md
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rednote_cli-0.1.5.tar.gz.
File metadata
- Download URL: rednote_cli-0.1.5.tar.gz
- Upload date:
- Size: 59.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
459a6129ef86dc82ee49bd17e4d0143eb0a51e4d0c39f4dccc837820d0e6a7c4
|
|
| MD5 |
fa2aa0b182e16cd0fca6343f148f4421
|
|
| BLAKE2b-256 |
288603d03232a542d913bfd7e9011b64a06b4908f3e9d9f2dd41d1289e295fe2
|
Provenance
The following attestation bundles were made for rednote_cli-0.1.5.tar.gz:
Publisher:
release-pypi.yml on lofe-w/rednote-scraper-docker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednote_cli-0.1.5.tar.gz -
Subject digest:
459a6129ef86dc82ee49bd17e4d0143eb0a51e4d0c39f4dccc837820d0e6a7c4 - Sigstore transparency entry: 1006505469
- Sigstore integration time:
-
Permalink:
lofe-w/rednote-scraper-docker@75c2020309319b1106e3b09eaa61a0af6554be57 -
Branch / Tag:
refs/tags/rednote-cli-v0.1.5 - Owner: https://github.com/lofe-w
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@75c2020309319b1106e3b09eaa61a0af6554be57 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rednote_cli-0.1.5-py3-none-any.whl.
File metadata
- Download URL: rednote_cli-0.1.5-py3-none-any.whl
- Upload date:
- Size: 82.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4a588af7d1cb6258097bd3f30971a46a5dae8bd463900aceba0dc7a8cbdf33d
|
|
| MD5 |
524e790ea70cd1d27c7ea15c44adcb73
|
|
| BLAKE2b-256 |
be352d10a19de7503ed35c8a2f1f99be2a71ca68764ba791d5d077f23cfb33fc
|
Provenance
The following attestation bundles were made for rednote_cli-0.1.5-py3-none-any.whl:
Publisher:
release-pypi.yml on lofe-w/rednote-scraper-docker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednote_cli-0.1.5-py3-none-any.whl -
Subject digest:
c4a588af7d1cb6258097bd3f30971a46a5dae8bd463900aceba0dc7a8cbdf33d - Sigstore transparency entry: 1006505471
- Sigstore integration time:
-
Permalink:
lofe-w/rednote-scraper-docker@75c2020309319b1106e3b09eaa61a0af6554be57 -
Branch / Tag:
refs/tags/rednote-cli-v0.1.5 - Owner: https://github.com/lofe-w
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@75c2020309319b1106e3b09eaa61a0af6554be57 -
Trigger Event:
push
-
Statement type: