Introduction¶
DeepSeek Harness (DSH) embraces the “everything is a plugin” philosophy, breaking capabilities down into independent modules. When developing Agents based on DSH, you will often encounter the need to retrieve YouTube video subtitles: the web client cannot yield complete captions, and manual downloads require extra development effort. The opencamel/dsh-yt-archive plugin gives Agents the ability to directly call the YouTube subtitle archive API, hosted by 2100laike YouTube Archive, supporting both archiving and retrieval.
Plugin Scope¶
dsh-yt-archive is a DSH tool plugin developed by maintainer opencamel. Through the 2100laike YouTube Archive service, it enables Agents to:
- Automatically submit caption-fetching tasks for unarchived videos, wait for completion, and return the full Markdown text
- Directly read subtitles of already-archived videos without consuming quota
- Retrieve multi-language subtitles, organized by language with timestamps
- Support forced re-fetching via
refresh: true
Core Capabilities¶
Unarchived Videos: Automatic Archiving and Full-Text Return¶
When an Agent encounters a YouTube video link, it calls the yt_archive tool instead of scraping the web page directly. For unarchived videos, the plugin automatically submits an archive request, fetches all language subtitle tracks (including auto-generated ones), then polls until the fetch completes, and finally returns the full Markdown text.
Archived Videos: Deduplication Hit, Instant Return¶
If the video has been previously archived, the plugin directly returns the latest full caption text. This process consumes no quota and remains readable even after the video has been deleted or made private.
Multi-Language Capture with Timestamps¶
The returned content is organized into language sections (## Language Name), with each line prefixed by [mm:ss] timestamps. A language list languages is also returned, where auto-generated tracks are labeled as asr.
Version History¶
If subtitles have been updated, you can pass refresh: true when calling to force a re-fetch of the new version (protected by a server-side 24-hour cooldown).
Environment Requirements¶
- dsh ≥ 0.1.0-rc.6: The plugin depends on
@deepseek-ai/dsh-tools >= 0.1.0-rc.6; older dsh versions may fail to resolve the peer dependency - pnpm on PATH:
dsh plugindelegates execution to pnpm underneath; a missing binary will cause errors
Installation and Activation¶
Plugins are installed per profile: they must be installed into the profile that is actually running to appear in that environment. Before installing, ensure the dsh version meets the requirement and that pnpm is on PATH.
Installation commands:
# Web GUI users (dsh web i.e., web profile)
dsh plugin --profile web add github:opencamel/dsh-yt-archive#v0.1.1
# CLI-only users (headless profile: dsh --profile headless "task description" runs once and exits)
dsh plugin --profile headless add github:opencamel/dsh-yt-archive#v0.1.1
After installation, you must restart the dsh process for changes to take effect: if the GUI is running when you install the plugin, the tool will not appear in the current session; in headless mode, each invocation is a new process, so no restart is needed.
After installation, verify with the following command:
dsh --profile <name> --dump-config | grep -A2 yt-archive
# Expected output:
# # == dsh-yt-archive
# - id: dsh-yt-archive
# name: dsh-yt-archive
Configuration¶
Override settings as needed in the profile’s cordis.patch.yml (changes take effect hot). Do not modify cordis.yml in the same directory — that file is an auto-regenerated composite root config rewritten by dsh on every startup.
- insert:
- id: dsh-yt-archive
name: dsh-yt-archive
config:
apiBaseUrl: 'https://api.2100laike.com' # Archive API endpoint
token: '' # Optional PAT, see below
waitTimeoutSec: 60 # Polling timeout (seconds) for caption fetch on new videos
pollIntervalSec: 2 # Polling interval (seconds)
maxContentChars: 30000 # Max characters in returned body; excess is truncated with a snapshot link (minimum 1000)
Quota and PAT¶
Anonymous usage allows 8 calls/day per plugin instance (counter resets on restart). After registering a real account and creating a PAT to fill in token, the quota is raised to 100 calls/day.
- Register an account at app.2100laike.com/register (email verification code);
- After logging in, go to Settings → Developer on the main site to create a PAT (with
pat_2100_prefix, scope at leastapi:write); - Enter the PAT into this plugin’s
tokenconfig field.
After upgrading the quota, you can check remaining daily allowance via GET /v1/yt/archive/quota (wx / x / wb / yt archives share the same counter).
Tool Contract¶
| Field | Value |
|---|---|
| Name | yt_archive |
| Parameters | url (string, required) · refresh (boolean, default false) |
| Returns | { archive_id, url, title, author, channel, duration_sec, views, languages, version, fetched_at, deleted, refresh_skipped, snapshot_url, truncated, fetch_error_code, markdown, note } |
The returned languages is a list of subtitle languages ({ code, name, kind }, where kind: "asr" indicates an auto-generated track). markdown is organized by language sections (## Language Name), with each line formatted as [mm:ss] text. author is the channel name, channel is the channel handle, duration_sec / views are the video duration (seconds) and view count.
Error Codes¶
When a call fails directly, the error message follows the format [yt-archive <ERROR_CODE>] description:
| Error Code | Meaning / Action |
|---|---|
RATE_LIMITED |
Daily quota exhausted → Register a real account and configure a PAT to raise the limit to 100 calls/day |
FORCE_NOT_ALLOWED |
refresh forced re-fetch requires a PAT → Configure token |
NOT_YT_VIDEO (422) |
Not a video page link (playlist/channel/search page, etc.) → Use a single video link (youtube.com/watch?v=…, youtu.be/…, shorts/…, live/…) |
Latency Expectations and Soft Failures¶
The following situations do not produce direct errors but are reflected in the returned note and fetch_error_code:
- Archived video: Deduplication hit, returned immediately, no quota consumed
- New video: Requires on-the-spot caption fetching; the plugin polls and waits, up to
waitTimeoutSec(default 60 seconds); on timeout, returns anotesaying “caption fetch not yet complete” — call again later (the video is now archived, so it returns instantly and does not consume quota again) - Video without subtitles (
fetch_error_code: yt_no_captions): Neither manual nor auto-generated captions exist — this is a terminal failure; the plugin returns early with anoteexplanation. There is no content to archive for such videos; do not retry repeatedly - Unavailable video (
fetch_error_code: yt_unavailable): Deleted/private/age-restricted — also a terminal failure; however, if subtitles were previously archived, they are returned normally withdeleted: truemarked - YouTube API error / rate limiting (
fetch_error_code: yt_api_error): Transient failure; upon timeout, thenoteexplains the situation — call again later - Caption snapshot read failure (server-side snapshot missing,
NO_CONTENT):notesuggests retrying later or visitingsnapshot_url
Truncation and Full Text¶
If the full caption text (multi-language combined) exceeds maxContentChars, it will be truncated (minimum 1000: if configured below 1000, 1000 applies). The response will be marked with truncated: true and include a snapshot_url — visit that link to view the complete snapshot. Subtitles for long videos are typically very long; increase this setting if you need more content.
Upgrade / Uninstall¶
# Overwrite upgrade to a new tag (e.g., v0.1.2)
dsh plugin --profile <name> add github:opencamel/dsh-yt-archive#v0.1.2
# Uninstall
dsh plugin --profile <name> remove dsh-yt-archive
After upgrading or uninstalling, you must restart the dsh process for that profile for changes to take effect.
Network and Security Statement¶
- The plugin accesses only the 2100laike archive API pointed to by the
apiBaseUrlconfig (defaulthttps://api.2100laike.com). Request content is limited to: the video URL passed by the caller, and (if configured) the user’s own PAT as a Bearer header - No use of eval / child_process; does not read any local credentials, environment variables, or sensitive paths; no telemetry of any kind
- Runtime dependencies are limited to official
@deepseek-ai/*packages (peerDependencies)
Build and License¶
Source repository: https://github.com/opencamel/dsh-yt-archive
pnpm install
pnpm build # esbuild compiles lib/index.js
pnpm typecheck # tsc --noEmit
pnpm pack # Produces an npm-structure tarball
The sha256 of the published tarball and the corresponding source commit are available in GitHub Releases.
License: MIT
Use Cases and Notes¶
- Suitable for DSH Agent developers who need multi-language subtitles from YouTube
- The plugin runs with the current dsh process’s permissions; review the source code and license before installation
- The DSH philosophy is “everything is a plugin”; the community directory is an independent site with no official affiliation to DeepSeek / High-Flyer
Conclusion¶
dsh-yt-archive leverages the 2100laike YouTube Archive service to provide DSH Agents with stable, complete YouTube subtitle archiving and retrieval capabilities, supporting common needs such as multi-language support, timestamps, and version history. Once installed and configured per profile, it is ready to use. Combined with the quota upgrade path, it can support high-frequency invocations.
- Directory page: https://www.skillhub.cn/plugins/opencamel/dsh-yt-archive
- GitHub: https://github.com/opencamel/dsh-yt-archive