Skip to content

fix: hand DiamWall 513 challenges to the bypasser - #1400

Open
vansh-nagar wants to merge 2 commits into
calibrain:mainfrom
vansh-nagar:fix/http-513-challenge
Open

vansh-nagar wants to merge 2 commits into
calibrain:mainfrom
vansh-nagar:fix/http-513-challenge

Conversation

@vansh-nagar

@vansh-nagar vansh-nagar commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

Recognize DiamWall interstitials in both the HTTP retry path and the internal browser helper. HTTP 513 challenge responses go directly to the configured bypasser, while ordinary 513 responses keep the existing error behavior.

Fixes #1386

Testing

  • uv run --frozen --extra browser pytest -q -n 0 tests/download/test_http_challenge_513.py tests/bypass/test_internal_bypasser.py: 27 passed
  • Ruff lint and format checks passed

Copilot AI lite review requested due to automatic review settings September 26, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Update the internal bypasser’s challenge and unsolved-page detection for DiamWall.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Routes DiamWall HTTP 513 challenge responses to the configured browser bypasser while preserving normal 513 handling.

Changes:

  • Adds DiamWall challenge detection.
  • Hands matching responses to the bypasser.
  • Adds regression tests for challenge and non-challenge responses.

The internal browser bypasser still does not recognize DiamWall challenges, so the handoff may fail to solve them.

File Summary
tests/​download/​test_http_challenge_513.py Tests challenge routing and normal 513 behavior.
shelfmark/​download/​http.py Detects and hands off DiamWall 513 responses.
shelfmark/​bypass/​challenge.py Adds DiamWall detection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shelfmark/bypass/challenge.py
Copilot AI review requested due to automatic review settings September 26, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

Resolved since last review (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Z-Library HTTP 513 response never reaches the enabled browser helper

2 participants