feat(douyin):新增--notef参数,支持从txt/md文件读取正文预编辑内容
This commit is contained in:
@@ -103,8 +103,11 @@ sau bilibili --help
|
|||||||
sau douyin login --account <account_name>
|
sau douyin login --account <account_name>
|
||||||
sau douyin check --account <account_name>
|
sau douyin check --account <account_name>
|
||||||
sau douyin upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介"
|
sau douyin upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介"
|
||||||
|
图文正文1:
|
||||||
$noteText = @"图文正文"@
|
$noteText = @"图文正文"@
|
||||||
sau douyin upload-note --account <account_name> --images videos/demo1.png videos/demo2.png --title "图文标题" --note $noteText --tags 'tag1,tag2'
|
sau douyin upload-note --account <account_name> --images videos/demo1.png videos/demo2.png --title "图文标题" --note $noteText --tags 'tag1,tag2'
|
||||||
|
图文正文2:
|
||||||
|
sau douyin upload-note --account <account_name> --images videos/demo1.png videos/demo2.png --title "图文标题" --notef '图文文件路径' --tags 'tag1,tag2'
|
||||||
```
|
```
|
||||||
|
|
||||||
抖音卡login手动获取cookie:
|
抖音卡login手动获取cookie:
|
||||||
|
|||||||
+11
-1
@@ -547,6 +547,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|||||||
upload_note_parser.add_argument("--images", required=True, nargs="+", type=existing_file_path, help="Image file paths")
|
upload_note_parser.add_argument("--images", required=True, nargs="+", type=existing_file_path, help="Image file paths")
|
||||||
upload_note_parser.add_argument("--title", required=True, help="Note title")
|
upload_note_parser.add_argument("--title", required=True, help="Note title")
|
||||||
upload_note_parser.add_argument("--note", default="", help="Optional note content")
|
upload_note_parser.add_argument("--note", default="", help="Optional note content")
|
||||||
|
upload_note_parser.add_argument("--notef", default="", help="Read note content from file (txt/md)")
|
||||||
upload_note_parser.add_argument("--tags", default="", help="Comma-separated tags, such as tag1,tag2")
|
upload_note_parser.add_argument("--tags", default="", help="Comma-separated tags, such as tag1,tag2")
|
||||||
upload_note_parser.add_argument("--schedule", type=schedule_value, help=f"Schedule time in {schedule_help}")
|
upload_note_parser.add_argument("--schedule", type=schedule_value, help=f"Schedule time in {schedule_help}")
|
||||||
add_runtime_flags(upload_note_parser)
|
add_runtime_flags(upload_note_parser)
|
||||||
@@ -687,11 +688,20 @@ async def dispatch(args: argparse.Namespace) -> int:
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
if args.action == "upload-note":
|
if args.action == "upload-note":
|
||||||
|
# 如果指定了 --notef,读取文件内容作为 note
|
||||||
|
note_content = args.note
|
||||||
|
if args.notef:
|
||||||
|
note_file = Path(args.notef)
|
||||||
|
if not note_file.exists():
|
||||||
|
print(f"错误:文件不存在: {note_file}", file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
note_content = note_file.read_text(encoding="utf-8")
|
||||||
|
|
||||||
request = DouyinNoteUploadRequest(
|
request = DouyinNoteUploadRequest(
|
||||||
account_name=args.account,
|
account_name=args.account,
|
||||||
image_files=parse_image_files(args.images),
|
image_files=parse_image_files(args.images),
|
||||||
title=args.title,
|
title=args.title,
|
||||||
note=args.note,
|
note=note_content,
|
||||||
tags=parse_tags(args.tags),
|
tags=parse_tags(args.tags),
|
||||||
publish_date=args.schedule or 0,
|
publish_date=args.schedule or 0,
|
||||||
publish_strategy=publish_strategy,
|
publish_strategy=publish_strategy,
|
||||||
|
|||||||
Reference in New Issue
Block a user