Files
EveryPublish/skills/kuaishou-upload/scripts/examples/kuaishou_cli_template.py
T
home-dev-pookz 90d03dc15a 小红书重构
1. 图文上传
2. 视频上传(封面,定时)
3. cli
4. skill
5. 无头模式
2026-03-25 15:19:40 +08:00

64 lines
1.5 KiB
Python

from __future__ import annotations
import shlex
import subprocess
def run_command(command: list[str]) -> None:
print("Running:", " ".join(shlex.quote(part) for part in command))
subprocess.run(command, check=True)
def main() -> None:
account = "account_a"
# account_name is user-defined. One account_name maps to one account file.
# You can prepare multiple account names and run them in parallel.
commands = [
["sau", "kuaishou", "login", "--account", account],
["sau", "kuaishou", "check", "--account", account],
[
"sau",
"kuaishou",
"upload-video",
"--account",
account,
"--file",
"videos/demo.mp4",
"--title",
"Kuaishou video from Python",
"--desc",
"Kuaishou video description from Python",
"--tags",
"cli,video",
"--thumbnail",
"videos/demo.png",
"--headless",
],
[
"sau",
"kuaishou",
"upload-note",
"--account",
account,
"--images",
"videos/1.png",
"videos/2.png",
"videos/3.png",
"--title",
"Kuaishou note title from Python",
"--note",
"Kuaishou note from Python",
"--tags",
"cli,note",
"--headless",
],
]
for command in commands:
run_command(command)
if __name__ == "__main__":
main()