feat: 新增 API 获取内容方式并优化微信发布流程
This commit is contained in:
@@ -184,7 +184,8 @@ def publish_to_wechat(
|
||||
appid: str,
|
||||
appsecret: str,
|
||||
thumb_image_path: Optional[str] = None,
|
||||
thumb_image_url: Optional[str] = None
|
||||
thumb_image_url: Optional[str] = None,
|
||||
author: str = ""
|
||||
) -> bool:
|
||||
"""
|
||||
便捷函数:发布文章到微信公众号草稿箱
|
||||
@@ -196,6 +197,7 @@ def publish_to_wechat(
|
||||
appsecret: 微信公众号 AppSecret
|
||||
thumb_image_path: 封面图片本地路径(可选,与 thumb_image_url 二选一)
|
||||
thumb_image_url: 封面图片URL(可选,与 thumb_image_path 二选一)
|
||||
author: 作者
|
||||
|
||||
Returns:
|
||||
是否成功
|
||||
@@ -219,7 +221,8 @@ def publish_to_wechat(
|
||||
result = publisher.add_draft(
|
||||
title=title,
|
||||
content=content,
|
||||
thumb_media_id=thumb_media_id
|
||||
thumb_media_id=thumb_media_id,
|
||||
author=author
|
||||
)
|
||||
|
||||
print(f"[WeChat] 草稿添加成功,media_id: {result.get('media_id')}")
|
||||
|
||||
Reference in New Issue
Block a user