auto-weixin-video
Original:🇨🇳 Chinese
Translated
3 scriptsChecked / no sensitive code detected
WeChat Channels Auto-Publishing Skill. Use this skill when you need to publish videos to WeChat Channels. The skill includes functions such as obtaining login cookies, uploading videos, setting titles and topics, scheduled publishing, original content declaration, etc.
2installs
Added on
NPX Install
npx skill4agent add zrt-ai-lab/opencode-skills auto-weixin-videoTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →WeChat Channels Auto-Publishing Skill
This skill is used to automate video publishing to the WeChat Channels Creator Center.
Usage Scenarios
- When users need to publish videos to WeChat Channels
- When users say "publish to Channels", "upload to Channels", "publish to WeChat Channels"
- When users have video files that need to be distributed to the WeChat Channels platform
Technical Principle
Based on Playwright browser automation, simulates real user operations on the WeChat Channels Creator Center (https://channels.weixin.qq.com):
- WeChat QR code login is required for first-time use, and cookies will be saved
- Automatic login using saved cookies for subsequent uses
- Automatically fills in information such as title, topics, short title, etc.
- Supports scheduled publishing, original content declaration, and adding to collections
Prerequisites
1. Install Dependencies
bash
pip install playwright
playwright install chromium2. Obtain Login Cookie for First-Time Use
bash
python .opencode/skills/auto-weixin-video/scripts/get_cookie.pyAfter execution, a browser will open. Log in via WeChat QR code, and the cookie will be automatically saved after successful login.
Workflow
Step 1: Verify Login Status
Check if the cookie exists and is valid:
bash
python .opencode/skills/auto-weixin-video/scripts/check_cookie.pyIf the cookie is invalid, re-obtain it:
bash
python .opencode/skills/auto-weixin-video/scripts/get_cookie.pyStep 2: Prepare Video Files
Video file requirements:
- Format: (recommended)
.mp4 - Resolution: Recommended 1080x1920 (vertical 9:16) or 1920x1080 (horizontal 16:9)
- Duration: Best within 1 minute
Step 3: Publish Video
bash
python .opencode/skills/auto-weixin-video/scripts/publish.py \
--video "video file path" \
--title "video title" \
--tags "topic1,topic2,topic3" \
[--original] \
[--schedule "2025-01-31 18:00"]Parameter Description
| Parameter | Short Form | Description | Required |
|---|---|---|---|
| | Video file path | ✅ |
| | Video title | ✅ |
| | Topic tags, separated by commas | ❌ |
| | Declare as original content | ❌ |
| | Original content type (e.g., Life, Technology) | ❌ |
| | Scheduled publishing time (format: YYYY-MM-DD HH:MM) | ❌ |
| Save as draft instead of publishing | ❌ | |
| Run in headless mode (browser not displayed) | ❌ |
Usage Examples
bash
# Publish immediately
python .opencode/skills/auto-weixin-video/scripts/publish.py \
-v ~/Videos/demo.mp4 \
-t "I learned a super practical trick today" \
-g "dry goods sharing, efficiency improvement, learning"
# Declare original + scheduled publishing
python .opencode/skills/auto-weixin-video/scripts/publish.py \
-v ~/Videos/demo.mp4 \
-t "Weekend Vlog | A cozy time alone" \
-g "vlog, weekend daily, life record" \
--original \
-s "2025-02-01 18:00"
# Save as draft
python .opencode/skills/auto-weixin-video/scripts/publish.py \
-v ~/Videos/demo.mp4 \
-t "Test Video" \
--draftDirectory Structure
.opencode/skills/auto-weixin-video/
├── skill.md # Skill documentation
├── scripts/
│ ├── get_cookie.py # Obtain login cookie
│ ├── check_cookie.py # Check cookie validity
│ └── publish.py # Main video publishing script
└── cookies/
└── weixin_video.json # Cookie storage file (automatically generated)Notes
- Cookie Validity Period: WeChat cookies have a relatively short validity period, so it is recommended to check before each use
- Publishing Frequency: It is recommended to control the publishing frequency to avoid being identified as abnormal behavior by the platform
- Short Title: The system will automatically generate a short title of 6-16 characters from the main title
- Number of Topics: It is recommended to add 3-5 relevant topics
- Original Content Declaration: Checking the original content option must comply with the platform's original content specifications, otherwise penalties may be imposed
- Collections: If the account has collections, the video will be automatically added to the first collection
Frequently Asked Questions
Q: What to do if the cookie becomes invalid?
A: Re-run and log in via QR code.
get_cookie.pyQ: What to do if upload fails?
A: Check the network connection and confirm the video file format is correct. WeChat Channels supports H264 encoding best.
Q: How to publish in batches?
A: You can write a loop script to call in sequence, with an interval of a few minutes between each publication recommended.
publish.pyReference Project
This skill refers to the implementation of the social-auto-upload project.