小红书重构

1. 图文上传
2. 视频上传(封面,定时)
3. cli
4. skill
5. 无头模式
This commit is contained in:
home-dev-pookz
2026-03-25 15:19:40 +08:00
parent ce9a9f102e
commit 90d03dc15a
32 changed files with 1325 additions and 98 deletions
@@ -0,0 +1,62 @@
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", "xiaohongshu", "login", "--account", account, "--headless"],
["sau", "xiaohongshu", "check", "--account", account],
[
"sau",
"xiaohongshu",
"upload-video",
"--account",
account,
"--file",
"videos/demo.mp4",
"--title",
"Xiaohongshu video from Python",
"--desc",
"Xiaohongshu video description from Python",
"--tags",
"cli,video",
"--thumbnail",
"videos/demo.png",
"--headless",
],
[
"sau",
"xiaohongshu",
"upload-note",
"--account",
account,
"--images",
"videos/1.png",
"videos/2.png",
"--title",
"Xiaohongshu note title from Python",
"--note",
"Xiaohongshu note from Python",
"--tags",
"cli,note",
"--headless",
],
]
for command in commands:
run_command(command)
if __name__ == "__main__":
main()