Repository navigation
Download the Automation Build and enable all captcha types - #24
Conversation
Users should not have to fetch chromium_automation.zip themselves, and the Nopecha Manifest Config should turn on every captcha type instead of leaving solver flags at the zip defaults. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for amralhams ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
4EYES44
left a comment
There was a problem hiding this comment.
| Level | Count |
|---|---|
| P0 | 0 |
| P1 | 0 |
| P2 | 1 |
| contested | 0 |
debate-review on 2730937, main cursor, second cursor.
Ship with one non-blocking fix. The PR cleanly implements Automation Build downloading, version-based cache invalidation, user-supplied directory preservation, and automatic enabling of all captcha flags in the Nopecha Manifest Config. No blocking issues remain; the only agreed finding is a minor inconsistency where _cache_is_stale() strips whitespace and a leading v prefix from version while _automation_zip_url() interpolates raw self.version into the GitHub release download URL.
| def _automation_zip_url(self) -> str: | ||
| if self.version: | ||
| return _AUTOMATION_ZIP_TAG.format(tag=self.version) | ||
| return _AUTOMATION_ZIP_LATEST |
There was a problem hiding this comment.
Note
P2, agreed by both reviewers. Passing a v-prefixed or whitespace-padded version string (such as version="v0.6.1", matching manifest["version_name"]) passes the staleness check on a warm cache but fails with HTTP 404 when downloading.
_cache_is_stale() normalizes self._desired_tag() via _normalized_version() (value.strip().lstrip("vV")), so version="v0.6.1" matches a cached manifest["version_name"] of "v0.6.1". However, _automation_zip_url() formats raw self.version directly (if self.version: return _AUTOMATION_ZIP_TAG.format(tag=self.version)), requesting .../releases/download/v0.6.1/chromium_automation.zip, which returns 404 because NopeCHALLC/nopecha-extension release tags omit the v prefix (for example 0.6.1 and 0.6.0), and a whitespace-only version=" " is also truthy and produces a malformed URL.
Suggested: Normalize version with _normalized_version() (and treat blank strings as unset in __init__ or helper methods) before using it in _automation_zip_url() and _desired_tag(), so both cache comparison and download URL construction use the same normalized release tag.
The second pass confirmed that _cache_is_stale() strips v/V and whitespace while _automation_zip_url() interpolates raw self.version into a release URL that expects unprefixed tags, so the non-blocking finding stands.
There was a problem hiding this comment.
Fixed in 912bd0a. _pinned_release_tag() now feeds both _desired_tag() and _automation_zip_url(), so version="v0.6.1" downloads .../download/0.6.1/chromium_automation.zip and a blank/whitespace version is treated as unset (latest).
A v-prefixed or blank version passed the cache check but requested a 404 tag URL. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
load()fetcheschromium_automation.zipfrom NopeCHA GitHub releases instead of the Web Store CRX, and re-downloads whenmanifest["version_name"]differs from the latest tag (or a pinnedversion=).*_auto_solve/*_auto_openflag andenabled, while leaving delay times, selectors, JS/HTML, and the top-level Chrome"key"alone.Closes #16.
Test plan
uv run python -m unittest discover -s tests -v(20 tests)Nopecha(api_key=...)with noextension_path, thenload(with_command_line_option=False)and confirmextensions/NopeCHA/manifest.jsonhas the key and captcha types enabledextension_pathto an unpacked Automation Build and confirm no GitHub download occursMade with Cursor