重构douyin上传,增加douyin图文

修复douyin视频封面上传
This commit is contained in:
home-dev-pookz
2026-03-24 23:02:22 +08:00
parent fe6e9f4af9
commit 90845f50ad
18 changed files with 1303 additions and 230 deletions
@@ -0,0 +1,56 @@
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 = "creator"
commands = [
["sau", "douyin", "login", "--account", account, "--headless"],
["sau", "douyin", "check", "--account", account],
[
"sau",
"douyin",
"upload-video",
"--account",
account,
"--file",
"videos/demo.mp4",
"--title",
"Douyin video from Python",
"--tags",
"cli,video",
"--thumbnail",
"videos/demo.png",
"--headless",
],
[
"sau",
"douyin",
"upload-note",
"--account",
account,
"--images",
"videos/1.png",
"videos/2.png",
"--note",
"Douyin note from Python",
"--tags",
"cli,note",
"--headless",
],
]
for command in commands:
run_command(command)
if __name__ == "__main__":
main()
@@ -0,0 +1,24 @@
# PowerShell examples for the installed sau CLI.
$account = "creator"
$video = "videos/demo.mp4"
$thumbnail = "videos/demo.png"
$noteImages = @("videos/1.png", "videos/2.png")
sau douyin login --account $account --headless
sau douyin check --account $account
sau douyin upload-video `
--account $account `
--file $video `
--title "Douyin video from PowerShell" `
--tags "cli,video" `
--thumbnail $thumbnail `
--headless
sau douyin upload-note `
--account $account `
--images $noteImages `
--note "Douyin note from PowerShell" `
--tags "cli,note" `
--headless
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
account="creator"
video="videos/demo.mp4"
thumbnail="videos/demo.png"
sau douyin login --account "$account" --headless
sau douyin check --account "$account"
sau douyin upload-video \
--account "$account" \
--file "$video" \
--title "Douyin video from bash" \
--tags "cli,video" \
--thumbnail "$thumbnail" \
--headless
sau douyin upload-note \
--account "$account" \
--images "videos/1.png" "videos/2.png" \
--note "Douyin note from bash" \
--tags "cli,note" \
--headless