Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Contributing to LibreGet
- Questions and help: Discussions or Telegram
- Bugs and feature requests: Issues
- Security vulnerabilities: SECURITY.md (do not open a public issue)
Before writing code
Read GLOSSARY.md, DESIGN.md, and docs/adr/ for canonical naming, UI tokens, and existing architecture decisions. UI changes must follow ACCESSIBILITY.md. Comment on an open issue before starting work so two people do not solve the same thing, and open a discussion before implementing large features or new plugins.
LibreGet does not accept changes that bypass DRM, break paywalls, or expose user credentials. Add new UI strings only in src/lib/i18n/en.json; translations for the other 11 locales are managed on Weblate (configured in .weblate), so do not submit machine-translated locale files in feature PRs.
Setup
1.97.0 — pinned in rust-toolchain.toml (
rustfmt+clippy) so host and plugin ABIs match18+ (LTS) — CI runs
lts/*in .github/workflows/ci.yml10.29.3 — set via
packageManagerin package.json (corepack enable)bundled with Node — fallback to install pnpm (
npm i -g [email protected]); usepnpm install, notnpm install, becausepnpm-lock.yamlis authoritative
Platform system dependencies:
- Linux: install WebKitGTK, GTK tray, SSL, audio, PipeWire, and Clang/libclang headers (same packages CI installs in .github/workflows/ci.yml and .github/workflows/release.yml; include
xvfbif running headless UI lint or smoke tests):
sudo apt-get update && sudo apt-get install -y \
libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev \
libayatana-appindicator3-dev librsvg2-dev patchelf libasound2-dev \
libpipewire-0.3-dev clang libclang-dev
- macOS: install Xcode Command Line Tools (
xcode-select --install;src-tauri/build.rscallsxcode-select -pfor Swift runtime paths). - Windows: WebView2 and MSVC Build Tools (
x86_64-pc-windows-msvc).
Clone, install dependencies, and start the dev app:
git clone https://github.com/OpenSelena/libreget.git
cd libreget
pnpm install
pnpm tauri dev
pnpm installrunsprepare, pointinggit config core.hooksPathto .githooks/ (pre-commitformats staged.rsfiles;pre-pushcheckscargo fmt). On Linux/macOS, make both scripts executable (chmod +x .githooks/pre-commit .githooks/pre-push) or runpnpm fmt:rsbefore committing.pnpm tauri devlaunches Vite onhttp://localhost:1420(src-tauri/tauri.conf.json) alongside the Tauri backend. SetTAURI_DEV_HOSTfor mobile or LAN testing (Vite HMR runs on port1421invite.config.js).pnpm devruns only the SvelteKit/Vite frontend when working on UI or Vitest modules without compiling Rust. Vite automatically runsscripts/generate-i18n-keys.json startup (pnpm buildruns it in strict mode and fails on locale mismatches unlessLIBREGET_I18N_STRICT=0).pnpm tauri build --config '{"bundle":{"createUpdaterArtifacts":false}}'creates a local release build without the maintainer'sTAURI_SIGNING_PRIVATE_KEY(createUpdaterArtifactsdefaults totrueinsrc-tauri/tauri.conf.json). On Linux,pnpm tauri:appimagewraps AppImage bundling throughscripts/linux/appimage.sh.pnpm plugins:deployis only for external dynamic plugin sibling checkouts (../libreget-plugin-courses,../libreget-plugin-telegram,../libreget-plugin-convert); built-in plugins insrc-tauri/plugins/already compile into the app binary.pnpm clean:cargo/pnpm clean:cargo:allrunscargo sweepinsidesrc-tauri/to clear stale build artifacts.
Codebase layout
src/routes/,src/components/,src/lib/— Svelte 5 / SvelteKit static SPA (@sveltejs/adapter-static, fallbackindex.html, aliases$liband$components). Design tokens and 14 app themes live insrc/app.cssandsrc/lib/style/; locale files (src/lib/i18n/*.json) and generatedsrc/lib/i18n/keys.tslive insrc/lib/i18n/.src-tauri/src/— Tauri v2 desktop host:commands/,cookies/,core/(download queue,queue_wal.rs, portable modeportable.rs, rules, host limiter),local_bridge.rs(authenticated extension bridge on127.0.0.1:47720–47729plus temporary/media/{t}HTTP range streams for WebKitGTK),mcp.rs(Streamable HTTP JSON-RPC MCP server onPOST /mcp),hotkey.rs,tray.rs,plugin_host.rs, andplugin_loader.rs. Register new Tauri commands in.invoke_handler(tauri::generate_handler![...])in src-tauri/src/lib.rs and declare needed permissions in src-tauri/capabilities/default.json.src-tauri/libreget-core/— Shared Rust engine (libreget-core): extractors insrc/platforms/, tool backends insrc/core/tools/, downloader/yt-dlp/FFmpeg wrappers insrc/core/, anddesktop/mobileCargo features.src-tauri/libreget-cli/— Standalonelibreget-clibinary (download,info,batch,search,archive, andimport-cookiessubcommands, with global--jsonand--proxyflags).src-tauri/libreget-plugin-sdk/&src-tauri/plugins/— Plugin SDK trait/ABI (ABI_VERSION = 3+libreget_plugin_build_inforustc fingerprint check), statically linked plugins (convert,telegram,courses), and local[patch.crates-io]grammers-session. Built-ins register viaPluginManager::register_builtinin src-tauri/src/lib.rs.browser-extension/— Manifest V3 Chrome (chrome/) and Firefox (firefox/) extensions bundled bysrc-tauri/tauri.conf.json. Edit shared files (src/,pages/,popup/,_locales/,icons/) inbrowser-extension/chrome/, sync tofirefox/withpnpm extension:sync(manifest.jsonstays per-browser), and package Chrome Web Store zips withnode browser-extension/chrome/scripts/package.mjs.flatpak/— Flatpak manifest (com.openselena.libreget.yml), desktop entry, offline dependency manifests, and AppStream metadata (com.openselena.libreget.metainfo.xml).scripts/— UI lint (lint-ui.mjs), accessibility and contrast audits (a11y-audit.mjs,contrast-audit.mjs), Clippy baseline (clippy-baseline.mjs), i18n keygen and locale sync (generate-i18n-keys.js,sync-locales.mjs), smoke runner (smoke-test.mjs), UI screenshot capture (shots.mjs), WAL crash fixture (wal-kill9.py), Linux AppImage helpers (linux/), and release version bumps (bump-version.js).
Branch workflow
Target dev for all pull requests. Pushes and PRs against dev run GitHub Actions CI (.github/workflows/ci.yml) across ubuntu-latest, debian:bookworm, windows-latest, and macos-latest (excluding weblate translation PRs on Rust and Flatpak jobs). Maintainers merge dev into main only after CI passes.
Local checks
Run the checks covering the areas you changed before pushing:
Frontend, i18n, and browser extension
pnpm check # svelte-kit sync + svelte-check
pnpm test # Vitest suite (src/**/*.test.ts in Node)
pnpm check:i18n # strict check that all 12 locales in src/lib/i18n/ match en.json
pnpm extension:sync # sync shared files from browser-extension/chrome/ to firefox/
node --test browser-extension/chrome/tests/*.test.mjs
- When adding or renaming translation keys in
src/lib/i18n/en.json, runpnpm generate:i18n-keysand commitsrc/lib/i18n/keys.ts(CI failsgit diff --exit-code -- src/lib/i18n/keys.tsif stale).node scripts/sync-locales.mjs --checkverifies locale key parity without writing. - Whenever modifying Svelte routes (
src/routes/), components (src/components/), or CSS (src/app.css,src/lib/style/), run targeted UI lint (.agents/skills/ui-lint/SKILL.md):
pnpm lint:ui /settings # single route (dark + light)
pnpm lint:ui --shell # all core routes against scripts/ui-lint-baseline.json
pnpm lint:ui /settings --all-themes # all 14 themes in src/app.css
- Optional Playwright and theme checks:
node scripts/a11y-audit.mjschecksprefers-reduced-motion, click target sizes, and keyboard focus visibility against a local Vite server;node scripts/contrast-audit.mjschecks WCAG contrast across the 14 themes.
Rust
pnpm check:fmt # or pnpm fmt:rs to format src-tauri/
pnpm check:clippy-baseline # checks crate|lint counts against src-tauri/clippy-baseline.<platform>.json
Inside src-tauri/:
cargo clippy --workspace --all-targets
cargo test --workspace
- On Windows, standalone test binaries linking Tauri/WebView without an application manifest fail with
0xc0000139, so runcargo test --workspace --exclude libreget-plugin-courses(matches CI). - Fix any new Clippy warning you introduce; do not run
pnpm update:clippy-baselineto silence new warnings. On Linux distributions wherepkg-configfiles sit in/usr/lib64/pkgconfig,scripts/clippy-baseline.mjsdefaultsPKG_CONFIG_PATHthere if unset.
Smoke test and Flatpak metainfo
node scripts/smoke-test.mjs src-tauri/target/debug/libreget
node scripts/smoke-test.mjs src-tauri/target/debug/libreget --portable
appstreamcli validate flatpak/com.openselena.libreget.metainfo.xml
On headless Linux, prefix smoke commands with xvfb-run -a. Pass .exe (libreget.exe) on Windows.
Environment variables
Runtime overrides and portable testing:
LIBREGET_DATA_DIR— overrides the profile/data directory (libreget-core/src/core/paths.rs,src-tauri/src/core/portable.rs,scripts/deploy-plugins-local.mjs)LIBREGET_PORTABLE=1— enables portable mode alongsideLIBREGET_DATA_DIR(set automatically whenportable.txtor.portablesits beside the executable)LIBREGET_RELAY— sets the P2P transfer relay server address (libreget-core/src/platforms/p2p.rs)LIBREGET_POT_PROVIDER_URL,LIBREGET_YTDLP_CHANNEL(nightlyorstable),LIBREGET_PYTHON— overrides yt-dlp PO-token provider URL, release channel, or Python binary (libreget-core/src/core/ytdlp.rs)
Development scripts and ignored live tests:
TAURI_DEV_HOST— exposes the Vite dev/HMR server (port 1421) for remote or mobile testing (vite.config.js)LIBREGET_I18N_STRICT=0/GENERATE_I18N_KEYS_STRICT=1— toggles strict locale validation in Vite (vite.config.js) andscripts/generate-i18n-keys.jsLIBREGET_SMOKE_EXIT_MS— auto-exit timeout in milliseconds forscripts/smoke-test.mjs(src-tauri/src/lib.rs)LIBREGET_SKIP_PLUGIN_DEPLOY=1— skips sibling plugin build and copy inscripts/deploy-plugins-local.mjsSHOTS_OUT— overrides the.shotsoutput directory forscripts/shots.mjs#[ignore]live Rust tests (cargo test ... -- --ignoredinlibreget-core):LIBREGET_YTDLP,LIBREGET_E2E_URL,LIBREGET_IG_COOKIES,LIBREGET_IG_TARGET,LIBREGET_SUBSTACK_COOKIES,LIBREGET_MEDIUM_COOKIES,LIBREGET_IMG,LIBREGET_PDF
Pull requests and AI tools
Write commit messages and PR titles in English (Conventional Commits such as feat(scope): ..., fix: ..., docs: ... preferred). Keep each PR focused on one change, update the translated READMEs (README.ja.md, README_pt_br.md, README.ru.md, README_zh_CN.md) when changing user-facing features in README.md, and fill out .github/pull_request_template.md.
AI coding tools are allowed if you read every line you submit, run the checks above and verify behavior in the running app yourself, check the AI disclosure box in .github/pull_request_template.md, and keep diffs focused. Bug and security reports must describe reproducible behavior you observed directly.
Participation in issues, pull requests, translations, and community channels follows CODE_OF_CONDUCT.md.