- Home
- Plugins
- Tools & Capabilities
- dsh-media-hub
dsh-media-hub
soffits/dsh-media-hub
A media hub for DeepSeek Harness: search shows, novels, ebooks and papers across sources, watch together in sync, and download books in the format you want onto your own shelf.
Install
dsh plugin --profile web add github:soffits/dsh-media-hubREADME
Media hub for DeepSeek Harness
One page in the DSH Web UI for shows, novels, ebooks and papers. Search every source at once, watch a show together from different places with play, pause, seeking and episodes in sync, and download a book in the format you want (epub, txt, pdf...) onto your own shelf.
This plugin was called Video Sync (@soffits/dsh-video-sync) until 0.2.0; the repository moved from soffits/dsh-video-sync, and room links made under the old name still open. It is not related to the npm package dsh-media-hub, which embeds a different self-hosted app.
-
Books: a book category (ebooks, novels, papers) gets filters for language, format, years and size. A result shows its cover, author, year, language, where the file comes from and the formats with their sizes; pick one and Download puts it on your shelf, then Save hands it to the device (Safari on iPhone offers Apple Books for an epub). With Calibre's
ebook-convertinstalled, a format the source doesn't have is converted from the best one it has. My books in the Library tab lists what you downloaded: save again, download again, delete. Each person signed in has their own shelf when a sign-in plugin provides therequestIdentityservice (dsh-oidc does); without one everyone shares one shelf. Files are shared between shelves and kept underbookCacheGb; past it the least recently used go and stay on the shelf to fetch again. -
Chat about it: every result and book has an Ask button that opens a new conversation with a draft quoting it, for you to finish and send.
-
Local files: one video or a folder of episodes (numbered files play in natural order). Videos browsers can't play or seek well are remuxed, or transcoded to HLS that plays a few seconds in while the rest is made, and cached. Subtitles next to a video (
.srt,.ass,.vtt, alsoname.zh.srt) and text subtitle tracks inside MKV files show up in the player; Chinese, Japanese and Korean legacy encodings are detected. -
Link: the address of a video or a playlist on any site yt-dlp reads (YouTube, Vimeo, Bilibili and over a thousand more). It shows as one work with its thumbnail, length and episodes (a playlist's videos), and plays like any show from a source: the episode being watched is downloaded first, then the next few, and every viewer streams the same file from DSH. Pick the quality before watching: Auto (the best up to
maxHeight, in formats a browser plays as they are), a height, or Audio only. A link to a video inside a playlist plays that video; paste the playlist's own address for all of it. Captions come with each episode: every track a person made, plus machine-made ones only in your language and the video's own, never a machine translation into a third language. The player starts the one in your language, else the video's own when no machine translated it, else none, and names each track in its own language with auto on machine-made ones. An episode plays while it downloads: its video and audio are fetched side by side and served as HLS once a few seconds are in, and a room waiting on it shows one progress for the whole episode. Sites that need a signed-in account read thecookiessetting; other yt-dlp options go in yt-dlp's own config file. -
Sync: the room's state lives on the server with server timestamps; each browser corrects its own clock offset and drift (under 0.3 s ignored, 0.3–2 s caught up by playing 5 % faster or slower, more than 2 s by a seek). Opening a room, switching episode and seeking go through a waiting room, as in Plex: playback holds until every viewer can play a few seconds ahead, each listed as loading or ready, then everyone starts at the same instant; after 10 s anyone may start without the ones still loading. When someone's player stalls mid-episode, everyone pauses with "Waiting for " and resumes together. A dropped connection doesn't stop playback; the player resyncs when it's back.
-
Library: shows (a folder of episodes, or one file) in
<stateDir>/libraryand anylibraryRoots, with a poster frame, episodes, size, the total and the free space on the disk. Delete a show or one episode, rename a show, keep it. Watched episodes are marked in the library and in the room; a show watched to the end (its last episode, or every episode) is deletedautoDeleteDayslater unless someone keeps it, and the list says when. A show an open room plays can't be deleted or renamed. Opening a show again continues where its viewers stopped. -
Sources: one search box over All sources or one of them; each source is a configured command line tool that speaks a small JSON protocol (docs/source-protocol.md, the hub's public interface for extensions, see docs/extensions.md) and brings its kinds. The defaults are
fanqie(short dramas, audiobooks, novels) andbookfetch source(ebooks and papers); every request runs through the source's command, so any proxy its launcher enforces holds, and a wrapper for another site is one more entry. Watch opens it at once, for you alone (Watch together in the player opens that room to others where it stands and copies its link); Save to library adds the show; Download all (offline) keeps every episode on disk. Sources implement one small interface (src/sources/index.js). -
Search results as cards: cover, title, score, how many watched it ("36.7万次播放" or "36.7K plays", by the page language), episodes, whether it is finished, tags; Details shows everything the source gives (cast, heat, last update…) and the other seasons and linked works.
-
Pictures for everything: a work's cover, a show's poster and a room's preview all come from the host and are cached under
<stateDir>/covers: a source's cover through the source's own command (so its proxy keeps applying), a link's thumbnail through theproxiessetting, and a still of the video for local files and shows without a cover. A browser never contacts a site's CDN, and a placeholder shows only when there is no picture at all. -
Danmaku, comments and quality in the room: for a source that has them (Fanqie's short dramas), the episode's danmaku fly over the picture in time with it, switched on or off under the player, with their opacity, how much of the picture they cover and their size in the settings next to it (each viewer's own choice). The Comments tab reads what people wrote about the work on the site. When the source has the show in several sizes, the same settings pick the one the hub fetches, for everyone in the room, from the next episode. The full-screen button keeps the danmaku on the picture.
-
Details kept with a show: a show from a source keeps what the source said about its work (cover, score, popularity, tags, blurb, other fields, related works, episode titles), so the library, a room's About tab and the episode list show it at once; a missing or day-old copy is refreshed in the background, and a copy over a week old says when it was saved.
-
Follow: a followed work is checked about once a day through its source (and when someone opens it). A new season is added to the library as an empty show, grouped with the earlier ones and followed too, and shows under New in Watching and in the watch log; more episodes extend the show. With
notifyCommandset, that command gets one line of JSON on its standard input for each piece of news. -
Rolling cache: a show from a source lists every episode, but only a window is on disk: the episode people are on is fetched first, then the next few (
cacheAhead, 5), andcacheBehind(1) watched ones stay. Watched episodes that fall out of the window are deleted (the watch log still marks them watched). Jumping to an episode that is not cached fetches it first (the room shows it as preparing), then refills the window around it. A show kept offline (Download all (offline), or the library menu) is never trimmed. All cached episodes of other shows together stay undercacheLimitGb(5 GB): past it the least recently watched go first, never one near an open room. The library says cached N of M (and offline), and the episode list marks the ones not on disk. -
Watch log:
<stateDir>/watch-log.jsonl, one JSON object per line: rooms opened and closed, viewers joining and leaving, episodes started and finished, and where each viewer stopped (positionlines when someone leaves, the episode changes, the room closes, and every two minutes while playing). -
Access: only browsers signed in to DSH reach the rooms, the media and the sync channel. Names come from the sign-in plugin (dsh-oidc) when there is one.
Install
dsh plugin --profile web add github:soffits/dsh-media-hub
The bundle adds two rows: media-hub (the page, shelves, rooms, media) and media-hub-tools (the assistant's videosync tool for rooms). Needs ffmpeg/ffprobe on the PATH for local media, yt-dlp for Link (keep it current: sites change), the commands of the sources you use (fanqie from fanqie-cli, bookfetch from bookfetch-cli; a source is hidden without its command), and optionally Calibre's ebook-convert for format conversion. Coming from Video Sync: replace the @soffits/dsh-video-sync package with this one; an existing $DSH_HOME/videosync folder keeps being used. A source's command runs in <stateDir>/<source id>, so nothing it writes into its working folder lands in DSH's.
Use
- From the page: open Media in the sidebar (the
labelsetting renames it). Three tabs: Watching (the default) lists the rooms opened to others, with who is in them and the episode, with copying a room's link or closing it, and the shows someone started, to continue; Library manages the shows and starts or continues one; Discover searches: pick a source (All sources, every configured one, or Link to paste the address of a video or playlist), then one of that source's categories, then search. Before any search it shows what the sources put forward for that category (their rank lists and new arrivals, from a source'strendingverb) (Link has none). They are kept as dated copies and refreshed in the background about daily, so the page never waits on a site; All sources lists each source's boards under its name. Picks from arecommendershow on the Watching tab. The tab, source and category are in the page's URL (?vs-tab=library,?vs-tab=discover&vs-source=<id>&vs-kind=<id>), so a refresh and the back button keep them and a link can open a tab directly; the last source and category are remembered per browser. - Watching: a card at the top for the show someone is in now, or the one you watched last, over its blurred cover: who is in the room, where it stands, a strip of its episodes (watched, now, on disk), and joining them, or continuing alone, or Watch together to open it to others. Optional parts, each off until switched on in
presence: So far, a recap without spoilers kept with the show; How was it?, one tap that writes a rating into the watch log for a show finished or removed lately; and Picks, works a recommender extension suggests, each with its reason. Steps suggested for a show (written through the tool'sannotate) show on the card when @soffits/dsh-ui-actions is installed. - From the assistant:
videosyncwithaction: startandsource: localpluspath,source: linkplusurl(andquality), orsource: <source id>plusid(andoffline: trueto keep every episode), returns a link to send.listandclosemanage rooms,librarylists the shows,historysummarises the watch log (shows, episodes finished, where each viewer stopped, with whom, when).
A room link looks like https://dsh.example.com/?media-room=<room> (DSH's advertised URL, --public-url when set) and opens the panel on that room.
Languages
The page follows DSH's language setting. It ships in English, French and Chinese; its words are in locale/<tag>.json, one file per language, and the plugin offers whatever files are there, so a language is added by copying locale/en.json to locale/<tag>.json (a tag DSH knows, such as de or pt-BR) and translating the ui texts. A missing text falls back along DSH's chain for that language, ending at English. Counts, sizes, dates and language names are written by the browser's Intl for the viewer's language. Titles, tags and descriptions from sources stay as the source gives them.
Configuration
| Field | Default | |
|---|---|---|
label | empty | Name of the sidebar entry: a string, or { "<tag>": "text" } with one per language, picked by the viewer's language tag, then its primary subtag (pt-BR → pt), then en. Empty shows the page's own name (Media) in the viewer's language. |
libraryRoots | [] | More folders the panel may start rooms from. |
delivery | origin | origin serves media from DSH's own web server. r2 (object storage with signed links) is reserved and not built yet. |
stateDir | $DSH_HOME/media-hub (or an existing $DSH_HOME/videosync) | Open rooms, the default library folder (downloads go there), shelves and book files (books/), prepared media, posters, the watch log and library notes. |
maxHeight | 1080 | Taller videos are transcoded to this height. |
threads | 2 | ffmpeg threads; jobs run one at a time at low priority. |
emptyMinutes | 30 | A room closes this long after its last viewer left. |
unopenedHours | 24 | A room nobody opened yet closes this long after it was created. |
cacheDays | 7 | Prepared media no room uses is deleted after this long. |
autoDeleteDays | 7 | A show is deleted this long after it was watched to the end, unless kept. 0 keeps everything. |
cacheAhead | 5 | Rolling cache: episodes kept after the one being watched. |
cacheBehind | 1 | Rolling cache: watched episodes kept before it; older watched ones are deleted. |
cacheLimitGb | 5 | Rolling cache: most disk (GB) cached episodes of shows from a source may use, the prepared copies included. Kept-offline shows don't count. 0 is no limit. |
notifyCommand | [] | A command (program and fixed arguments) run with one line of JSON on stdin when a followed work gets a new season or new episodes. Empty runs nothing. |
presence | Continue card on, the rest off | Which parts of Watching show: continue (the Continue card), recap (So far, a recap kept with the show, only for viewers past what it covers), ratings (How was it?) and picks (needs recommender). |
recommender | none | { command, env }: a command speaking docs/recommender-protocol.md. Empty shows no picks. |
bingeNight | 01:00 to 06:00 | { from, to } on the host's clock. With @soffits/dsh-points installed, the people it plays with pay points for two extras: starting a series new to the hub, and starting to watch in this window. Everything else stays free; without that plugin nothing changes. |
coverCacheMb | 50 | Most disk (MB) pictures may use (covers, posters, previews). The browser never fetches them from a site; the least recently shown are dropped past this. 0 is no limit. |
ytDlp | yt-dlp | The yt-dlp command; Link is hidden without it. |
proxies | [] | Which proxy each outbound request takes, by host: a list of { url, hosts, hostsFile }. url is socks5h://host:port (names resolved by the proxy), socks5://, socks4://, http:// or https://; hosts are patterns (example.com is that host and every host under it, .example every host ending so, * every host); hostsFile a file of more patterns, one per line, # for comments, read again when it changes. The first rule naming a host wins; other hosts go direct. Every yt-dlp call takes the rule of the page's host, and a thumbnail the rule of its own host or its page's, so a picture on an unlisted CDN goes the way its site does. While a hosts file can't be read, or the proxy is down, the request fails rather than go direct. Sources' commands keep their own network setup. |
cookies | [] | Signed-in accounts for sites, by host: a list of { hosts, hostsFile, accounts }, hosts written as in proxies. Each account is { person, name, file, userAgent, share }: file a Netscape cookies file of a signed-in session (kept fresh by whatever holds that session; the hub only reads it and gives yt-dlp a private copy per run), userAgent the User-Agent that session uses, person the owner's sign-in id (empty for the default account everyone without their own uses), name what the page shows, share whether others without an account of their own may use it. A lookup or download uses the account of the person asking, else the default, else a shared one; a room uses the account of whoever opened it. |
bookCacheGb | 5 | Most disk (GB) downloaded books may use; past it the least recently used files go and stay on their shelves to fetch again. 0 is no limit. |
converter | ebook-convert | Calibre's converter; when installed, books can be downloaded in formats their source lacks. Empty turns conversion off. |
sources | fanqie, bookfetch | The sources: a list of { id, label, kinds: [{ id, label, media, trending }], filters, command: [program, ...fixed arguments], env }; label is the source's name in Discover's picker and each kind's label its category, each a string or { "<tag>": "text" } like the sidebar's; left empty, the page uses its own words for that id (source.name.<id>, kind.<id> in locale/), else the id; media is video, audio or book, trending (default false) says the command's trending verb answers for that kind; filters lists the search filters the command understands (language, format, year). The list replaces the default, so keep the default entries when adding one; an empty list turns sources off. See docs/source-protocol.md. |
The tools row takes agentName (shown as who opened the assistant's rooms) and waitSeconds (how long start waits for the first episode to be ready).
Development
npm test runs the unit tests (ffmpeg tests skip without ffmpeg). npm run test:browsers boots a throwaway DSH home with this checkout linked in and drives two Chromium contexts through a room: play, pause, seek, rate-based and seek-based drift correction, an episode switch and a reconnect; then the tabs with their state in the URL, the source and category pickers, a search through a stand-in source command, Watch together now with the room growing as episodes arrive, the watch log, watched marks, deleting an episode and a show from the library, and a link looked up and watched in a chosen quality through a stand-in yt-dlp, with every outbound call routed to a proxy that is down so the test never reaches the network.
License
MIT
Related plugins
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
next-ai-draw-io (dsh-plugin)
dayuanjiang/next-ai-draw-io
weknora
tencent/weknora