본문으로 건너뛰기
A

dsh_reader_by_obscura

alicesync/dsh_reader_by_obscura

dsh 读取插件,基于浏览器实现绕过js渲染

설치

dsh plugin --profile web add github:alicesync/dsh_reader_by_obscura

README

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.configEditor APIs).
  • 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.

  1. Bump version in package.json for a new release.
  2. Actions → Package plugin → Run workflow:
    • leave tag empty to use v<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.
  3. The run uploads dsh-obscura-*.tgz + SHA256SUMS.txt as artifacts and creates or updates the matching GitHub Release with the same files.
  4. 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

FieldDefaultMeaning
proxy(empty)HTTP/HTTPS/SOCKS proxy for the direct fetch and Obscura; empty = direct.
obscuraPath(empty)Explicit Obscura binary path.
stealthtrueRun Obscura with --stealth.
obscuraTimeoutSeconds20Obscura page timeout (5–120 s).
timeoutMs12000Direct fetch timeout (1–120 s).
maxChars200000Maximum characters returned; longer output is truncated.
modeautoauto, direct-only, or obscura-only.
fallbackQuality0.35Extraction quality below this triggers the Obscura fallback (0–1).
userAgent(empty)Custom User-Agent; empty uses a desktop Chrome UA.

How a fetch runs

  1. The page is fetched directly and classified (text/JSON is returned as-is).
  2. HTML is checked for challenge pages, then extracted and scored for readability.
  3. A blocked page, an empty shell, or extraction below fallbackQuality is fetched again through Obscura (--dump markdown).
  4. 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):

PageSourceStatusQualityWordsTime
example.comobscura (short-content fallback)2000.551222.8 s
BBC News articledirect2000.9965611.3 s
React docsdirect2000.99021121.1 s
Excalidraw (SPA shell)obscura (empty-shell fallback)200—837.5 s
G2 (Cloudflare)direct (blocked; fallback also blocked)4030.5189.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 = 0 because 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.

관련 플러그인