Skip to content

Installing AutoMiner

The server is one Linux box (a Raspberry Pi, a NAS, a PC). Anki and the Chrome extension run on your own computer and reach the server over your LAN or Tailscale.

On Windows, use the one-file installer instead: install-windows.md.

Terminal window
git clone https://github.com/Chrisyk/AutoMiner
cd AutoMiner
sh install.sh

install.sh does sections 1 and 2 below in one go: system packages (apt, pacman, dnf or Homebrew), uv, the venv with the speech detector (.[vad]) and its ~2 MB silero model, the built-in Yomitan’s Yomitan release, autominer on PATH, and a service: as root a systemd unit that starts at boot; otherwise a systemd user unit, or a launchd agent on macOS, that starts when you log in (loginctl enable-linger keeps the user unit running while you are logged out). It waits for the web UI and prints its address. Re-run it to upgrade. --no-packages skips the package manager, --no-service stops before the service. The rest of this page is the same done by hand.

Required whatever you watch: Python 3.11+, ffmpeg/ffprobe, the speech detector (below) on the server, and Anki with AnkiConnect on your computer.

You need git, Python 3.11 or newer, uv and ffmpeg (cuts every clip). Fetching Stremio videos by torrent runs in Docker and is set up from Settings: see self-host.md.

Arch Linux (incl. Arch Linux ARM)

Terminal window
pacman -S --needed git python uv ffmpeg

Debian / Ubuntu

Terminal window
apt install git python3 python3-venv ffmpeg curl
curl -LsSf https://astral.sh/uv/install.sh | sh # uv

Python older than 3.11 (Ubuntu 22.04)? uv python install 3.12 and uv uses it for the venv.

Installing YouTube (Settings › Sources › Add platform) downloads the standalone yt-dlp for this machine and the PO-token provider (bgutil’s bgutil-pot and its yt-dlp plugin), each checked against its pinned SHA-256, into $AUTOMINER_HOME/programs/youtube. AutoMiner uses that yt-dlp before one in its venv or on PATH, which stay the fallback; AUTOMINER_YTDLP still overrides. Uninstalling YouTube deletes the folder.

YouTube answers a server’s yt-dlp with “Sign in to confirm you’re not a bot”, or HTTP 403 on the video itself, far sooner than a browser. The pieces that keep it fetching:

  • Node.js (node on PATH, 22+): yt-dlp solves YouTube’s JS challenges with it.
  • PO tokens: the downloaded yt-dlp runs bgutil-pot, from bgutil-ytdlp-pot-provider-rs, only when it wants a token; nothing stays resident. It is pinned for Windows x64, Linux x86_64 and aarch64, and macOS x86_64 and arm64. Elsewhere, Windows arm64 for one, or where it does not run, YouTube fetches without PO tokens.
  • Current yt-dlp: AutoMiner checks yt-dlp’s latest release daily and replaces its own copy when the release’s SHA2-256SUMS lists a different SHA-256 for this machine’s file; the download must match it. On the Pi, deploy/autominer-ytdlp-update.timer also upgrades the venv’s fallback yt-dlp.
  • The VPN proxy (Settings › Services › VPN proxy URL, AUTOMINER_VPN_PROXY; Gluetun’s HTTP proxy, self-host.md): a call YouTube refuses from the server’s own address is made again through the proxy, and later calls keep to it for 6 hours (AUTOMINER_YOUTUBE_VPN: fallback, the default; always; off).
  • A refusal pauses every YouTube fetch (15 minutes, doubling to 6 hours) instead of each source asking again; the worker’s idle tick then asks again, one source at a time, for the video of a source mined without it and for fetches an older version failed on a bot check.
Terminal window
git clone https://github.com/Chrisyk/AutoMiner /opt/AutoMiner
cd /opt/AutoMiner/core
uv venv .venv && uv pip install -p .venv/bin/python -e ".[vad]"
mkdir -p ~/.local/share/autominer/models # /var/lib/autominer/models as root
curl -Lo ~/.local/share/autominer/models/silero_vad.onnx \
https://raw.githubusercontent.com/snakers4/silero-vad/master/src/silero_vad/data/silero_vad.onnx
.venv/bin/python ../yomitan/fetch_yomitan.py # the built-in Yomitan (optional, see section 3)
.venv/bin/autominer install-command # once: links `autominer` onto PATH
autominer setup # asks per feature, writes .env + secrets
autominer doctor # feature table, incl. ffmpeg / yt-dlp; exit 0 = healthy
autominer serve --host 0.0.0.0 --port 8801

The database is created on first start; there is no separate init step. An existing database from before commit 7f134861 (2026-11-05) has to be started once by that commit first; see Upgrading from an older release.

Optional: install .[test] too and run the test suite (.venv/bin/pytest tests/) to check the install. It takes a while and is not needed to use AutoMiner.

Open http://<server>:8801. A fresh install opens on the setup page (languages, Anki, dictionary, what you watch, transcription, readiness); everything there can also be changed later in Settings. The setup page installs no platform: install the ones you use in Settings › Sources › Platforms › Add (quickstart.md).

For a permanent install with systemd units and timers, see deploy/README-pi.md. The units pin /opt/AutoMiner and /var/lib/autominer.

  • Anki with the AnkiConnect add-on, reachable from the server. Put its URL in the setup page (or Settings › Services › AnkiConnect URL).
  • Chrome extension (extension/): load it unpacked, then paste the server URL in its popup. The setup page shows the URL with a copy button. It follows the video you play on each site an installed platform names (YouTube today), and Spotify web. If you install a platform whose site Chrome has not opened to the extension, its popup shows Allow site access: press it and accept Chrome’s prompt. If you decline, it does not ask again; you can still allow the site from the extension’s site access in Chrome.
  • Updating the extension from 0.11 or older: 0.12 takes the sites it tracks from the server, so update the server first (an older server names no sites, and the extension then tracks nothing). Then update the extension once by hand: pull the new code, open chrome://extensions and press the reload arrow on AutoMiner Capture (or remove it and load extension/ unpacked again). It then reads its sites from the server by itself. If the server is down at that moment, YouTube tracking resumes within five minutes of it coming back, or as soon as you open the popup.
  • Dictionaries (optional), for definitions, readings, pitch and frequency on cards: see below.

Every definition and card field comes from Yomitan, and so does every Japanese word key (Chinese and Korean words are keyed by AutoMiner’s own word splitter: see language-profiles.md). There are two ways to have one:

  • The built-in Yomitan (nothing to install on your computer). yomitan/ runs Yomitan’s own lookup code under Node.js 22.13 or newer, from the official Yomitan release that yomitan/fetch_yomitan.py downloads (install.sh runs it). AutoMiner starts it itself when no Yomitan API URL is set and nothing answers at http://127.0.0.1:19633. It starts without dictionaries and downloads nothing on its own: the setup page’s Dictionary (Yomitan) card offers Download recommended dictionaries, Yomitan’s own recommended dictionaries for your language (Japanese: Jitendex, BCCWJ, JPDBv2㋕ and Jiten, about 72 MB to download, about 800 MB on disk once imported, roughly ten minutes on a desktop PC and longer on a Raspberry Pi). Or put your own Yomitan dictionaries (.zip) in AUTOMINER_HOME/yomitan/dictionaries/ and press Import from folder. Until a dictionary is in, cards use the local dictionaries (Settings › Languages › Local dictionaries). Its data lives in AUTOMINER_HOME/yomitan/: options.json is Yomitan’s own options object (dictionary order, card formats); its first card format is filled for the Kiku note type. AUTOMINER_YOMITAN_BUILTIN=0 turns it off; =1 starts it even where a Yomitan API answers at 127.0.0.1:19633 (a test install beside a real Yomitan).
  • Your own Yomitan in your browser with the Yomitan API server: enable the API in Yomitan’s settings, run the API’s install_yomitan_api.py, and put its URL in the setup page (http://<your computer>:19633). This uses your dictionaries and card format as they are in your Yomitan; the built-in one then stays off.

Sync judgment and per-line word timing listen to the audio. Each runs in one of three places, chosen in Settings: クラウド (a paid API with a key), コンテナ (Docker on another PC or NAS) or このマシンで (on the server itself). To run them in Docker, see self-host.md.

Spotify tracking needs the Spotify platform installed (Settings › Sources › Platforms › Add), a Spotify developer app and three credentials, stored with autominer setup or autominer secret set NAME (SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, SPOTIFY_REFRESH_TOKEN). Authorize the refresh token with the scopes user-read-recently-played user-read-playback-state; the second one is what lets the tracker see episodes played on the phone. Spotify tracking runs inside AutoMiner and starts within 30 seconds of the platform being installed with all three stored; restart AutoMiner after changing one. Details: configuration.md. The whole setup, step by step: Adding Spotify and podcasts.