Install
openclaw skills install weibo-qr-login-skillFetch Weibo login QR code via OpenClaw browser integration. Use when the user asks to log in to Weibo or needs a Weibo QR code. Runs a Python script that handles browser startup, page navigation, QR extraction, and retry logic automatically.
openclaw skills install weibo-qr-login-skillFirst run scripts/setup.sh to ensure the environment is ready.
Then check for saved cookies with scripts/weibo_cookies.py check
before falling back to QR code login via scripts/fetch-weibo-qr.py.
openclaw browser ... commands.setup.sh ensures it is enabled and configured.Run the setup script before first use (idempotent, safe to re-run):
bash <SKILL_DIR>/scripts/setup.sh
Check the output carefully:
GATEWAY_RESTART_REQUIRED: the environment was just configured and the system will restart automatically in ~15 seconds. You must immediately reply to the user: "环境首次配置完成,系统将在几秒后自动重启。请等待约 20 秒后,重新发送「登录微博」。" Then stop. Do not run any other scripts in this turn — the gateway restart will terminate the current session.After setup succeeds (no GATEWAY_RESTART_REQUIRED), follow this sequence:
Step 1 — Check cookies:
python3 <SKILL_DIR>/scripts/weibo_cookies.py check
"valid": true: proceed to Step 2a (restore)."valid": false: skip to Step 2b (QR login).Step 2a — Restore saved session:
python3 <SKILL_DIR>/scripts/weibo_cookies.py restore
Reply to the user that login has been restored from saved cookies. Done.
If restore fails, skip to Step 2b — the browser may already be logged in, and fetch-weibo-qr.py will navigate to the login page to confirm.
Step 2b — QR code login:
python3 <SKILL_DIR>/scripts/fetch-weibo-qr.py
On success the script prints the local path of the QR PNG (e.g. /tmp/weibo-qr-1234.png). The agent must then:
MEDIA: <path> line in the reply (e.g. MEDIA: /tmp/weibo-qr-1234.png). OpenClaw will parse this and deliver the image through the active channel.fetch-weibo-qr.py to generate a fresh QR code.Step 3 — Save cookies after scan:
After the user confirms a successful scan:
python3 <SKILL_DIR>/scripts/weibo_cookies.py save
Confirm to the user that login succeeded and cookies have been saved for future use.
# Custom QR output path
python3 <SKILL_DIR>/scripts/fetch-weibo-qr.py --output /tmp/my-qr.png
# Verbose logs
python3 <SKILL_DIR>/scripts/fetch-weibo-qr.py --verbose
openclaw is in PATH.python3 --version to verify (requires Python 3.9+).fetch-weibo-qr.py to generate a new code.