✨douyin-cli
📢声明
本项目是面向抖音开放平台官方 OpenAPI 的命令行工具,同时保留部分公开网页数据处理能力,仅用于测试和学习研究,禁止用于商业用途或任何非法用途。
任何用户直接或间接使用、传播本仓库内容时责任自负,本仓库的贡献者不对该等行为产生的任何后果负责。
如果相关方认为该项目的代码可能涉嫌侵犯其权利,请及时联系我删除相关代码。
使用本仓库的内容即表示您同意本免责声明的所有条款和条件。如果你不接受以上的免责声明,请立即停止使用本项目。
🍬功能特性
- ✅ 官方 OpenAPI:支持通过
douyin api调用抖音开放平台官方接口 - ✅ Token 获取:支持
client_token与 OAuthaccess_token获取流程 - ✅ 通用请求:支持任意官方 OpenAPI 路径、查询参数、JSON body、表单和自定义请求头
- ✅ 环境变量:支持
DOUYIN_CLIENT_KEY、DOUYIN_CLIENT_SECRET、DOUYIN_ACCESS_TOKEN - ✅ 命令行安装:通过
uv tool install .安装为本机douyin命令 - ✅ 兼容能力:保留旧版网页数据命令,适合已有脚本迁移
🚀快速开始
环境要求
- Python 3.13
- uv 0.9+
- 抖音开放平台应用的
client_key/client_secret - Node.js(仅旧版网页数据命令需要)
- aria2c(可选,仅旧版下载命令需要)
安装命令
uv tool install .
官方 OpenAPI
# 获取 client_token
douyin api client-token \
--client-key "$DOUYIN_CLIENT_KEY" \
--client-secret "$DOUYIN_CLIENT_SECRET"
# 用 OAuth code 换 access_token
douyin api access-token \
--client-key "$DOUYIN_CLIENT_KEY" \
--client-secret "$DOUYIN_CLIENT_SECRET" \
--code "授权码"
# 调用任意官方 OpenAPI 路径
douyin api request GET /oauth/userinfo/ \
--token "$DOUYIN_ACCESS_TOKEN" \
--param open_id=xxx
📖 详细使用说明请查看 USAGE.md
📊 技术栈
- 运行时: Python 3.13
- 命令行: Click
- 官方接口: 抖音开放平台 OpenAPI
- HTTP 客户端: niquests
Star History
Metadata
Release files for douyin-cli 5.3.260515
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| douyin_cli-5.3.260515.tar.gz | 35.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| douyin_cli-5.3.260515-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.4 kB
Release files / douyin_cli-5.3.260515.tar.gz
| Download URL | douyin_cli-5.3.260515.tar.gz |
|---|---|
| Size | 35.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01eed4da901e4854879e329e707a9c7eee840eda60c0352c39ce6ff4c686ad16
|
|
BLAKE2b-256 checksum How to use checksums |
47cf546cd6edffbd74a9b09deb9f284a88eeccadd5972a3f87c8d35dc267c487
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / douyin_cli-5.3.260515-py3-none-any.whl
| Download URL | douyin_cli-5.3.260515-py3-none-any.whl |
|---|---|
| Size | 44.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5afaa828a220aa8515b44af817560f903526bdf9c72b388a2516177d2bc7bba5
|
|
BLAKE2b-256 checksum How to use checksums |
d38fc28411cecbcb1cc3200d5373ce7c70c0ad1da1cdff41bbb532cc6986dbe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for douyin-cli 5.3.260515
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.