Xiaohongshu Publisher
This skill automates the process of posting content to Xiaohongshu (Little Red Book) using Playwright. It supports both image and video uploads, along with title and content (description) text.
Setup Instructions
- 1. Install Dependencies:
CODEBLOCK0
- 2. Initial Login:
Before you can post, you must perform a manual login once to save your session state. Run the login script:
python .trae/skills/xhs-publisher/scripts/login.py
This will open a browser window. Scan the QR code or log in using your preferred method. Once logged in, the script will save the session to
state.json.
Usage
To post content, use the post.py script:
CODEBLOCK2
Arguments
- *
--title: The title of the post. - INLINECODE3 : The description or caption for the post.
- INLINECODE4 : One or more paths to the images or video files you want to upload.
Notes
- * The script uses a visible browser window by default (
headless=False) to help you monitor the process and handle any unexpected popups or captchas. - Ensure your files are in supported formats (e.g., JPG, PNG, MP4).
小红书发布器
该技能使用Playwright自动化发布内容到小红书平台。支持图片和视频上传,以及标题和内容(描述)文本。
设置说明
- 1. 安装依赖:
bash
pip install playwright requests
playwright install chromium
- 2. 初始登录:
在发布内容之前,您需要手动登录一次以保存会话状态。运行登录脚本:
bash
python .trae/skills/xhs-publisher/scripts/login.py
这将打开一个浏览器窗口。扫描二维码或使用您偏好的方式登录。登录成功后,脚本将会话保存到state.json文件中。
使用方法
要发布内容,请使用post.py脚本:
bash
python .trae/skills/xhs-publisher/scripts/post.py \
--title 您的帖子标题 \
--content 您的帖子描述内容。#标签 \
--files /路径/到/图片1.jpg /路径/到/图片2.png
参数说明
- * --title:帖子的标题。
- --content:帖子的描述或说明文字。
- --files:要上传的一个或多个图片或视频文件的路径。
注意事项
- * 脚本默认使用可见浏览器窗口(headless=False),以便您监控发布过程并处理任何意外弹窗或验证码。
- 请确保您的文件格式受支持(例如JPG、PNG、MP4)。