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-video

SKILL.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):
  1. WeChat QR code login is required for first-time use, and cookies will be saved
  2. Automatic login using saved cookies for subsequent uses
  3. Automatically fills in information such as title, topics, short title, etc.
  4. Supports scheduled publishing, original content declaration, and adding to collections

Prerequisites

1. Install Dependencies

bash
pip install playwright
playwright install chromium

2. Obtain Login Cookie for First-Time Use

bash
python .opencode/skills/auto-weixin-video/scripts/get_cookie.py
After 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.py
If the cookie is invalid, re-obtain it:
bash
python .opencode/skills/auto-weixin-video/scripts/get_cookie.py

Step 2: Prepare Video Files

Video file requirements:
  • Format:
    .mp4
    (recommended)
  • 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

ParameterShort FormDescriptionRequired
--video
-v
Video file path
--title
-t
Video title
--tags
-g
Topic tags, separated by commas
--original
-o
Declare as original content
--category
-c
Original content type (e.g., Life, Technology)
--schedule
-s
Scheduled publishing time (format: YYYY-MM-DD HH:MM)
--draft
Save as draft instead of publishing
--headless
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" \
    --draft

Directory 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

  1. Cookie Validity Period: WeChat cookies have a relatively short validity period, so it is recommended to check before each use
  2. Publishing Frequency: It is recommended to control the publishing frequency to avoid being identified as abnormal behavior by the platform
  3. Short Title: The system will automatically generate a short title of 6-16 characters from the main title
  4. Number of Topics: It is recommended to add 3-5 relevant topics
  5. Original Content Declaration: Checking the original content option must comply with the platform's original content specifications, otherwise penalties may be imposed
  6. 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
get_cookie.py
and log in via QR code.

Q: 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
publish.py
in sequence, with an interval of a few minutes between each publication recommended.

Reference Project

This skill refers to the implementation of the social-auto-upload project.