feat(wechat-channel): add draft upload functionality for video channel

- Add isDraft parameter to TencentVideo class to control publishing behavior
- Modify click_publish method to click "保存草稿" instead of "发表" when isDraft is true
- Update post_video_tencent function to accept and pass is_draft parameter
- Add is_draft parameter to /postVideo API endpoint to receive frontend data
- Add "视频号上传草稿" checkbox in frontend that appears only for video channel platform
- Update defaultTabInit to include isDraft property with default value false
- Include isDraft in publishData sent to backend API
- Implement proper URL checking for draft vs publish success confirmation

The new functionality allows users to save WeChat Channel videos as drafts
instead of immediately publishing them when the checkbox is selected.
This commit is contained in:
Deroino
2025-11-13 09:12:39 +08:00
parent c0e7b64b94
commit 81b71d023d
4 changed files with 46 additions and 17 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ from utils.constant import TencentZoneTypes
from utils.files_times import generate_schedule_time_next_day
def post_video_tencent(title,files,tags,account_file,category=TencentZoneTypes.LIFESTYLE.value,enableTimer=False,videos_per_day = 1, daily_times=None,start_days = 0):
def post_video_tencent(title,files,tags,account_file,category=TencentZoneTypes.LIFESTYLE.value,enableTimer=False,videos_per_day = 1, daily_times=None,start_days = 0, is_draft=False):
# 生成文件的完整路径
account_file = [Path(BASE_DIR / "cookiesFile" / file) for file in account_file]
files = [Path(BASE_DIR / "videoFile" / file) for file in files]
@@ -25,7 +25,7 @@ def post_video_tencent(title,files,tags,account_file,category=TencentZoneTypes.L
print(f"视频文件名:{file}")
print(f"标题:{title}")
print(f"Hashtag:{tags}")
app = TencentVideo(title, str(file), tags, publish_datetimes[index], cookie, category)
app = TencentVideo(title, str(file), tags, publish_datetimes[index], cookie, category, is_draft)
asyncio.run(app.main(), debug=False)