dsh_reader_by_obscura
alicesync/dsh_reader_by_obscura
dsh 读取插件,基于浏览器实现绕过js渲染
インストール
dsh plugin --profile web add github:alicesync/dsh_reader_by_obscuraREADME
dsh-obscura-reader
English | 中文
A DeepSeek Harness plugin that reads a page as clean Markdown, with readability-style extraction, and falls back to the Obscura headless browser when a site blocks direct requests. Direct HTTP runs first, through your configured proxy.
Features
- Readable output: main content is scored, cleaned and converted to Markdown (headings, lists, code, quotes, images, tables).
- Anti-bot fallback: Cloudflare, captchas,
403/429, consent walls and JS-only shells are retried through Obscura. - Proxy aware: HTTP/HTTPS/SOCKS5/SOCKS5H for the direct fetch and the Obscura subprocess.
- Zero runtime dependencies: Node.js built-in modules only; no DOM library, no build step.
- Control panel on the Plugins page: the bundle's own section and its row's Configure page.
Requirements
- DeepSeek Harness with the Web GUI (uses the documented
ctx.web,ctx.webServer,ctx.connection,ctx.configEditorAPIs). - Node.js 20 or newer.
- Optional: the official Obscura binary, Apache-2.0, installed separately (see below).
Install Obscura
Use only the official releases at https://github.com/h4ckf0r0day/obscura/releases and verify them against SHA256SUMS:
VERSION=v0.2.8 # latest release
curl -LO "https://github.com/h4ckf0r0day/obscura/releases/download/${VERSION}/obscura-x86_64-linux.tar.gz"
curl -LO "https://github.com/h4ckf0r0day/obscura/releases/download/${VERSION}/SHA256SUMS"
sha256sum -c <(grep 'obscura-x86_64-linux.tar.gz' SHA256SUMS)
tar xzf obscura-x86_64-linux.tar.gz
install -m 755 obscura obscura-worker ~/.local/bin/
Use the aarch64-linux archive on ARM64, the macos archives on Apple hardware, and the -stealth variants for anti-detection. The plugin resolves the binary from the panel's Binary path, then OBSCURA_PATH/OBSCURA_BIN, PATH, and common locations such as ~/.local/bin/obscura.
Install the plugin
Web UI: Plugins → Add plugin, enter this checkout's absolute path (or a Git URL), install, then Enable now.
CLI:
dsh plugin add /absolute/path/to/dsh-obscura-reader
Discover (optional): add https://raw.githubusercontent.com/AliceSync/dsh_search_by_obscura/main/plugin-index.json under Plugins → Discover → Add index source to list both Obscura plugins.
Packaging and releases
Packaging is manual and always publishes a GitHub Release; no workflow runs on push or pull request, and it does not run tests.
- Bump
versioninpackage.jsonfor a new release. - Actions → Package plugin → Run workflow:
- leave
tagempty to usev<version>; an existing tag is packaged as-is, otherwise it is created from the selected branch/commit; - or enter a tag: an existing tag is packaged as-is, a missing tag is created from the selected code.
- leave
- The run uploads
dsh-obscura-*.tgz+SHA256SUMS.txtas artifacts and creates or updates the matching GitHub Release with the same files. - Install the Release asset in DSH with Plugins → Add plugin (tarball URL or downloaded
.tgz).
The tarball is the npm pack package, not a source ZIP; the workflow verifies it contains dsh.bundle.patch, the web client half, locales and the icon before publishing.
Control panel
Open Plugins → dsh-obscura-reader for the configuration section on the bundle page, or the row's Configure page. A plugin's own configuration belongs on the Plugins page, not in Settings.
The panel configures the proxy, output limit, timeouts, strategy and fallback quality, checks the Obscura binary, and runs a live Test fetch. Use Obscura reader writes web.fetchProvider through the Harness web settings form (the same control the official Web search page uses); Restore DeepSeek fetch writes deepseek-fetch-api back.
Configuration
| Field | Default | Meaning |
|---|---|---|
proxy | (empty) | HTTP/HTTPS/SOCKS proxy for the direct fetch and Obscura; empty = direct. |
obscuraPath | (empty) | Explicit Obscura binary path. |
stealth | true | Run Obscura with --stealth. |
obscuraTimeoutSeconds | 20 | Obscura page timeout (5–120 s). |
timeoutMs | 12000 | Direct fetch timeout (1–120 s). |
maxChars | 200000 | Maximum characters returned; longer output is truncated. |
mode | auto | auto, direct-only, or obscura-only. |
fallbackQuality | 0.35 | Extraction quality below this triggers the Obscura fallback (0–1). |
userAgent | (empty) | Custom User-Agent; empty uses a desktop Chrome UA. |
How a fetch runs
- The page is fetched directly and classified (
text/JSON is returned as-is). - HTML is checked for challenge pages, then extracted and scored for readability.
- A blocked page, an empty shell, or extraction below
fallbackQualityis fetched again through Obscura (--dump markdown). - Output is truncated to
maxChars; a non-2xx response is reported as data, not an error.
Verification
Live run with the official Obscura v0.2.8 binary through an HTTP proxy (2026-12-02, Node 26):
| Page | Source | Status | Quality | Words | Time |
|---|---|---|---|---|---|
| example.com | obscura (short-content fallback) | 200 | 0.55 | 122 | 2.8 s |
| BBC News article | direct | 200 | 0.996 | 561 | 1.3 s |
| React docs | direct | 200 | 0.990 | 2112 | 1.1 s |
| Excalidraw (SPA shell) | obscura (empty-shell fallback) | 200 | — | 83 | 7.5 s |
| G2 (Cloudflare) | direct (blocked; fallback also blocked) | 403 | 0.51 | 8 | 9.6 s |
The offline suite has 133 unit tests (node --test).
Limitations
- PDFs, images and binary bodies are not extracted; only HTML and text pages are read.
- Cloudflare hard challenges cannot always be bypassed; blocked pages return the direct result plus diagnostics.
- Pure-Obscura fetches report
statusCode = 0because the CLI does not expose an HTTP status.
Attribution and license
- Obscura — https://github.com/h4ckf0r0day/obscura, licensed Apache-2.0. It is an optional external executable installed by the user; this package neither bundles nor modifies it, and provides no Obscura code.
- DeepSeek Harness — https://github.com/deepseek-ai/deepseek-harness, MIT. This plugin targets its documented extension points and copies none of its source.
- React — MIT, supplied by the Harness Web client at runtime; not bundled here.
- Node.js — runtime only; the plugin uses built-in modules.
This package is MIT licensed (see LICENSE). See THIRD_PARTY_NOTICES.md for the full notices.
Development
node --check index.js client.js src/*.js
node --test # offline unit tests
node scripts/live-reader.mjs # live probe; reads OBSCURA_PROXY / OBSCURA_PATH
index.js registers the host plugin and routes; client.js is the browser panel; src/ holds the dependency-free proxy client, Obscura wrapper, HTML extraction, challenge detection, reader orchestration, config and control routes.