Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > cross-seed

cross-seed finds torrents on your other trackers that match data you already have, and adds them to your torrent client so they seed straight away with nothing to download. Check each tracker's rules before cross-seeding. 17402 was randomly generated for this article; you may use any 5-digit port between 10000 and 32767.

Installation

  1. Connect to your slot via SSH.
  2. Install cross-seed with the server's Node.js: npm install --prefix ~/cross-seed cross-seed@6 npm warns that better-sqlite3 has install scripts not covered by allowScripts; the warning can be ignored.
  3. Make the cross-seed command available (skip the PATH line if you've already done it for another program): mkdir -p ~/bin && ln -sf ~/cross-seed/node_modules/.bin/cross-seed ~/bin/cross-seed echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc
  4. Generate the configuration file: cross-seed gen-config
  5. Set the port and listen on the server only: sed -i -e 's/port: 2468,/port: 17402,/' -e 's/host: "0.0.0.0",/host: "127.0.0.1",/' ~/.cross-seed/config.js

Configuration

Open the configuration file with nano ~/.cross-seed/config.js. Each option has a comment explaining it; the options reference has more detail. Don't delete options you aren't using. cross-seed won't start until the following are set:

  • torznab: one URL per indexer, each ending in /api and including the API key.
    • Prowlarr: on the Indexers page, click an indexer and copy its Torznab URL, then add ?apikey= and the API key from Settings > General, for example "https://app.example.box.ca/1/api?apikey=YOUR_KEY".
    • Jackett: use Copy Torznab Feed on an indexer, then add api?apikey= and the API key shown at the top of the page, for example "https://app.example.box.ca/api/v2.0/indexers/INDEXER/results/torznab/api?apikey=YOUR_KEY".
  • torrentClients: the client cross-seed adds torrents to. Replace PASSWORD with the client's password.
    • rTorrent: ["rtorrent:https://user:PASSWORD@server.whatbox.ca/xmlrpc"]
    • qBittorrent: ["qbittorrent:http://user:PASSWORD@localhost:WEBUI_PORT"], where WEBUI_PORT is the port under Tools > Options > WebUI in qBittorrent.
    • Deluge and Transmission formats are listed in the options reference.
  • linkDirs: a folder inside ~/files for the hardlinks cross-seed makes, for example ["/home/user/files/cross-seed"]. Hardlinks take no extra space. This is required unless you set matchMode: "strict",. See the linking guide for matchMode and linkType.

Save with Ctrl + S and exit with Ctrl + X.

Starting cross-seed

  1. Start the daemon: screen -dmS cross-seed node /home/user/cross-seed/node_modules/cross-seed/dist/cmd.js daemon
  2. Check that it's running: screen -ls should list cross-seed. If it doesn't, run cross-seed daemon to see the configuration errors, fix them in the config file, press Ctrl+C and repeat step 1.
  3. Show your API key, which other apps need to talk to cross-seed: cross-seed api-key

You can watch cross-seed's output with screen -r cross-seed, and detach again with Ctrl+A, then D.

Search on download completion (optional)

cross-seed searches your indexers on its own schedule (searchCadence, rssCadence). To also search as soon as a torrent finishes, have the client call cross-seed's webhook. Replace YOUR_API_KEY with the key from cross-seed api-key.

  • qBittorrent: Tools > Options > Downloads, tick Run external program on torrent finished and enter: curl -XPOST http://localhost:17402/api/webhook?apikey=YOUR_API_KEY --data-urlencode "infoHash=%I"
  • autobrr: follow the announce guide, using http://localhost:17402/api/announce?apikey=YOUR_API_KEY as the endpoint.

Automatically Restart (optional)

  1. Create a script: touch ~/cross-seed_restart.cron && nano -w ~/cross-seed_restart.cron
  2. Paste in:
#!/bin/bash
if pgrep -fx "node /home/user/cross-seed/node_modules/cross-seed/dist/cmd.js daemon" > /dev/null
then
    echo "cross-seed is running."
else
    echo "cross-seed is not running, starting cross-seed"
    screen -dmS cross-seed node /home/user/cross-seed/node_modules/cross-seed/dist/cmd.js daemon
fi
exit
  1. Save and exit, then make it executable: chmod +x ~/cross-seed_restart.cron
  2. Open your crontab with EDITOR=nano crontab -e and add:
@reboot /home/user/cross-seed_restart.cron >/dev/null 2>&1
*/5 * * * * /home/user/cross-seed_restart.cron >/dev/null 2>&1

Only needed if something outside your slot, such as autobrr on another machine, sends announces or webhooks to cross-seed. Add a custom app on the Manage Links page named cross-seed with port 17402, then use https://cross-seed.example.box.ca in place of http://localhost:17402. Every request still needs the API key.

Updating

  1. Comment out the cron lines with EDITOR=nano crontab -e if you set them up.
  2. Stop cross-seed: pkill -fx "node /home/user/cross-seed/node_modules/cross-seed/dist/cmd.js daemon"
  3. Update: npm install --prefix ~/cross-seed cross-seed@6
  4. Start it again with step 1 of Starting cross-seed, and uncomment the cron lines.

Moving from the yarn install

Earlier versions of this article installed cross-seed with nvm and yarn. Your configuration in ~/.cross-seed works as it is.

  1. Stop the old daemon: screen -S cross-seed -X quit
  2. Remove the yarn install: yarn global remove cross-seed node-gyp
  3. Remove the line PATH=$HOME/.yarn/bin:$PATH from ~/.bashrc with nano ~/.bashrc, then run source ~/.bashrc.
  4. Follow Installation steps 2 and 3, then Starting cross-seed. If you used the old restart command in your crontab, replace it with the script above.

nvm can stay; if nothing else uses it, remove ~/.nvm and the nvm lines at the end of ~/.bashrc.

Uninstalling

  1. Stop cross-seed and remove the cron lines, as in Updating.
  2. Remove the program and its data: rm -r ~/cross-seed ~/.cross-seed ~/bin/cross-seed ~/cross-seed_restart.cron
  3. Torrents cross-seed added stay in your client. Remove them there before deleting your linkDirs folder.

Troubleshooting

  • cross-seed: command not found: run source ~/.bashrc, or redo Installation step 3.
  • invalid XML or 401 for an indexer: the Torznab URL is wrong or missing its API key. Use the per-indexer URL ending in /api, not the indexer manager's base address.
  • RangeError: WebAssembly.instantiate(): Out of memory: put NODE_OPTIONS=--disable-wasm-trap-handler in front of screen in the start command and the restart script.
  • cross-seed stops straight after starting: the configuration is invalid. Run cross-seed daemon to see why; each error names the option to fix.