# Conflicts: # src-tauri/tauri.conf.json # src/components/NowPlaying.vue # src/player.ts
11 KiB
Grabster — agent notes
Grabster is a Usenet downloader for Linux (developed on Nobara / Fedora) whose UI is an homage to the early-2000s P2P clients (WinMX era): grey bevelled Win9x chrome, a row of big tab buttons, dense black list panes with yellow/green/red/cyan column text, Tahoma 11px. It is a front end only: NZBGet does all downloading (NNTP, yEnc, par2, unpack) and Newznab indexers provide search. NZBGet is bundled: Grabster starts its own copy by default ("built-in" mode) and can still talk to an external one ("My own NZBGet"). A built-in player plays finished downloads, and rqbit (also bundled) streams torrents from Torznab indexers (Prowlarr, Jackett) into that player.
The owner is a senior frontend dev (Vue 3, TypeScript, CSS, graphic-design background). Keep code
idiomatic Vue 3 <script setup> + TS, no UI framework, hand-written CSS.
Hard rules
- Original branding only. Never use the WinMX name, logo, icons or text in the app. Recreate the
general look (colours, bevels, layout density), not its assets. Icons are hand-drawn SVGs in
src/components/Icon.vue; add new ones there in the same 16×16 pixel style. - "Grabster" is a placeholder name; renaming means
package.json,index.html,src-tauri/tauri.conf.json(productName, identifier, window title),src-tauri/Cargo.toml,src-tauri/src/main.rs(grabster_lib), and strings insrc/state.ts/App.vue. - Don't reinvent the download engine. Talk to NZBGet over JSON-RPC.
- Mock mode must keep working:
npm run devin a plain browser usesservices/mock.ts. Any new engine/search capability needs a mock implementation too.
Stack
- Tauri 2 (thin Rust shell) + Vue 3 + TypeScript + Vite.
- Tauri plugins:
http(CORS-free fetch to NZBGet/indexers),store(settings.json),opener(open folders),dialog(pick .nzb files). - Custom Rust commands:
read_file_base64insrc-tauri/src/lib.rs;media_list/media_trashinsrc-tauri/src/media.rs(loopback HTTP server with Range support so<video>can play finished downloads: random port + per-launch token, only serves files it listed; "Ditch" moves to the Trash and only for listed folders strictly inside the download folder);builtin_engine_start/builtin_engine_stopinsrc-tauri/src/engine.rs(spawns the bundled NZBGet in server mode, random port + password written to its 0600 nzbget.conf, PR_SET_PDEATHSIG, flock against a second instance, SIGTERM on exit).torrent_add/torrent_stats/torrent_removeinsrc-tauri/src/torrent.rs(starts the bundled rqbit on first use: random port, random Basic-auth password in its env, UPnP off, only a torrent's playable files viaonly_files). Shared helpers for both engines (spawn_supervised,wait_for_port,terminate) live in engine.rs;src-tauri/src/http.rsis a tiny loopback HTTP client for rqbit. - Torrent streams are proxied through media.rs (
Source::Remote): the page never sees rqbit's password, suffix ranges become explicit ones (rqbit doesn't parsebytes=-N), and the MKV subtitle fix runs lazily on the first request (it reads the file head through rqbit). - Bundled rqbit:
scripts/fetch-rqbit.sh(pinned version + SHA-256 per arch) intosrc-tauri/resources/rqbit/(git-ignored). Downloads go to~/Downloads/Grabster/Torrents; session + DHT cache (XDG_CACHE_HOME) + rqbit.log in~/.local/share/com.orca.grabster/rqbit/. rqbit API notes:POST /torrents?list_only=true(body = magnet/URL) to peek at files,?overwrite=true&only_files=1,4,GET /torrents/{hash}/stats/v1("mbps" is MiB/s),POST /torrents/{hash}/delete|forget, stream at/torrents/{hash}/stream/{file}. - Bundled NZBGet:
scripts/fetch-nzbget.sh(pinned version + SHA-256) unpacks intosrc-tauri/resources/nzbget/(git-ignored), shipped viabundle.resourcesin tauri.conf.json. Runtime data:~/.local/share/com.orca.grabster/nzbget/.${AppDir}in NZBGet's config is the read-only resources folder — keep writable paths under${MainDir}. __NV_DISABLE_EXPLICIT_SYNC=1is set inrun()when the NVIDIA driver is loaded: WebKitGTK on Wayland + NVIDIA EGL dies with "Error 71 (Protocol error)" otherwise. Don't go back toWEBKIT_DISABLE_DMABUF_RENDERER=1: it also avoids the crash but forces CPU compositing (~2x CPU during video in a large window, visible stutter).- Video: WebKitGTK 2.54 never loads an MKV with subtitle tracks (stuck at readyState 0), so
media.rsserves subtitle TrackType bytes as "metadata". tiny_http needswith_chunked_threshold(usize::MAX)or it drops Content-Length and seeking breaks. - Visualizer (music):
src/visualizer/(audio.ts = Web Audio tap + beat detection + mock tap, presets.ts = GLSL presets, renderer.ts = WebGL2 feedback ping-pong) +components/Visualizer.vue. NeedscrossOrigin="anonymous"on the media element AND media.rs's CORS header (app origins only), or WebKit gives the analyser silence. After tapping, volume lives on a GainNode. The AudioContext is created on the first click/key (suspended context = no sound at all). Feedback presets must fade to black (max(prev * k - c, 0)) or they build up haze. - App icon:
src-tauri/icons/grabster.svgis the source; re-render the PNGs with Inkscape (inkscape grabster.svg -w N -h N -o NxN.png). The .rpm's desktop entry comes fromsrc-tauri/grabster.desktop(Tauri's own category list has no Network). - Permissions live in
src-tauri/capabilities/default.json— add a permission there when using a new plugin API (e.g.core:window:allow-set-titleis already there).
Layout
src/
main.ts, App.vue shell: banner row, tab buttons, status bar, fake title bar in browser mode
state.ts global reactive `app`, polling loop, search sessions, download()
player.ts built-in player: one media element (or a mock timer), playlist, Keep/Ditch prompt;
`player.item` is a Playing (a finished `download` or a torrent `stream`)
styles.css bevel classes (.raised/.sunken/.btn/.field), .listview, colour classes
services/
types.ts Settings, SearchHit/SearchRow, QueueItem, HistoryItem, EngineStatus
backend.ts Engine, SearchProvider, MediaLibrary, TorrentEngine interfaces
nzbget.ts NZBGet JSON-RPC (status, listgroups, history, append, editqueue, rate, config,
loadconfig/saveconfig/reload for news servers, testserver)
newznab.ts Newznab/Torznab XML search + caps test (DOMParser, newznab:attr; torznab
seeders/peers/magneturl → SearchHit.torrent). Indexer.kind picks which.
media.ts MediaLibrary (list playable files / trash a download) via Tauri commands
torrent.ts TorrentEngine (add / stats / remove) via Tauri commands
mock.ts simulated engine + media + catalog (invented artists, Linux ISOs, public-domain films)
settings.ts load/save via tauri store or localStorage
platform.ts isTauri, appFetch, openFolder, setWindowTitle, pickNzbFiles
format.ts bytesGrouped ("350 758 444"), mb, rate, age, duration, catLabel
components/
ListView.vue generic sortable black list (columns config + #cell-<key> slots)
SettingsDialog.vue modal: tree on left, pages on right, Close / Reset Defaults
NowPlaying.vue player strip above the status bar (transport, LCD title/time, seek, volume)
PlayerStage.vue the <video>: fills the tab area, mini corner window, or fullscreen; mock test card
KeepDitchDialog.vue "Finished playing — Keep or Ditch?"
Slider.vue Win9x trackbar
Icon.vue original pixel icons
views/ one per tab: Networks, Library, Chat, Search, Hotlist, Transfers, Bandwidth
src-tauri/ Rust shell, tauri.conf.json, capabilities, icons
Conventions
- Colour meaning in lists:
.yyellow = ages/categories/times,.ggreen = good/speed/grabs,.rdred = failed/passworded,.cycyan = indexer names/post-processing,.grgrey = secondary. - Search legend: yellow row text = already in history, cyan = in queue, blue row bg = downloading.
- Every view puts its left status-bar text in
app.viewStatus[tab](App.vue renders the one bar). - Buttons are
.btn; pressed/toggled state is.down; active tab is.tab.active. - NZBGet
editqueueuses the v18+ signature(Command, Param, IDs). - Editing NZBGet config:
loadconfig(file contents, not runtime-ooverrides) → change →saveconfig(replaces the WHOLE file) →reload. Never save fromconfig. KeepAlivewraps the views — guard anything that measures DOM (see the zero-width check in BandwidthView's canvas draw, which once caused an infinite loop).
Commands
npm install
npm run dev # browser, mock data, http://localhost:1420
npm run tauri dev # real app with the bundled NZBGet (needs Rust/WebKit deps, see README)
npm run fetch:nzbget # (re)download the bundled NZBGet; tauri dev/build run it automatically
npm run build # vue-tsc type-check + vite build
npm run build:preview # single-file mock-mode HTML in dist-preview/
npm run tauri build # .rpm + AppImage in src-tauri/target/release/bundle
Always run npx vue-tsc --noEmit after changes.
Status
- v0.1 front end type-checks, builds, and was visually checked in headless Chromium (mock mode).
- Rust side builds and runs on Nobara (Nov 2026); .rpm bundles NZBGet 26.3 (~12 MB).
- Built-in engine tested: start, news server save/reload round trip, testserver, shutdown on crash.
- Not yet tested with a real Usenet provider or real indexers.
- Torrent streaming: end-to-end test against the real bundled rqbit passes
(
cargo test --lib -- --ignored real_rqbit: adds the Creative Commons Sintel magnet, seeks through the proxy). Mock flow checked in headless Chromium. Not yet tried in the real app UI. - Player: playback goes through WebKitGTK → GStreamer, so codecs need
gstreamer1-plugin-libav(installed on the owner's Nobara). Mock-mode flow checked in headless Chromium; not yet tried in the real app.
Roadmap / ideas
- Test with the owner's Usenet provider + indexers; check the AppImage bundle.
- Visual polish pass against reference screenshots (spacing, fonts, colours).
- Right-click context menus; resizable/remembered column widths.
- Torrents, next steps: list kept torrents in Library/Transfers (rqbit
GET /torrents), stop seeding after a ratio, optional bind-to-VPN-interface setting (rqbit--bind-device). - Hotlist auto-grab: poll saved searches / RSS and send new matches to NZBGet.
- Chat tab as an IRC client.
- Per-indexer API hit counters; indexer priority.
- Maybe someday: native Rust NNTP engine to drop the NZBGet dependency.