jackwener / jackwener/OpenCLI

weixin download: should wait for captcha auto-resolve instead of failing immediately

Open
#2,045 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
29.5k
Forks
2.9k
Avg merge
15h 36m
Merged PRs (30d)
70

Description

## Problem

When using `opencli weixin download` with a WeChat article long URL (`mp.weixin.qq.com/s?__biz=...&mid=...&idx=...&sn=...`), WeChat redirects to a captcha verification page. The current adapter immediately detects this and reports failure:

```
│ Error │ - │ - │ failed — verification required in WeChat browser page │ - │ - │
```

However, this captcha **auto-resolves after a few seconds** without any human interaction. The adapter treats it as a terminal failure instead of a transient intermediate state.

## Reproduction

```bash
opencli weixin download --url "https://mp.weixin.qq.com/s?__biz=MzkzMTk0MDM5NA==&mid=2247483793&idx=1&sn=c1ed1c6e5b03ce05a382473dacbe2f13"
```

Both `--window foreground` and `--window background` modes fail with the same error.

## Evidence: Playwright successfully loads the same URL

Using Playwright MCP with the exact same URL:

1. `browser_navigate` → redirected to captcha page (`wappoc_appmsgcaptcha`)
2. `browser_wait_for` 5-8 seconds → captcha auto-resolves
3. Page loads successfully with full article content

The captcha appears to be a simple JS challenge that resolves on its own — no drag/click interaction needed.

## Suggestion

When the weixin adapter detects the captcha/verification page, instead of immediately failing:

1. Wait for a configurable timeout (e.g., 10-15 seconds)
2. Poll or listen for navigation back to the article URL
3. Only report failure if the captcha does not resolve within the timeout

## Environment

- opencli: v1.8.5
- Extension: v1.0.21
- OS: macOS (Darwin 24.5.0)
- Node: v24.12.0

Contributor guide

Open the contributing guide

Research direction

The entry point mentioned is `opencli weixin download`; begin by tracing the WeChat adapter's captcha or verification detection and navigation wait behavior. Reproduce with the supplied URL in both window modes, then verify that transient captcha pages are retried until the article loads or the timeout expires, with failure only after the timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, playwright
Domain
cli, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.