Add a torrent to qBittorrent by searching Prowlarr indexers or fetching a magnet link from Nyaa. Use when the user wants to manually download a specific release that Sonarr/Radarr can't find automatically.
Add a torrent to qBittorrent by searching Prowlarr or fetching from Nyaa.
Determine the source from $ARGUMENTS:
magnet:, add it directlySearch Prowlarr (if needed):
docker exec prowlarr cat /config/config.xml and extract the <ApiKey> valuecurl -s "http://localhost:9696/api/v1/search?query=<url-encoded-query>&type=search" -H "X-Api-Key: <key>"http://localhost:9696/*/download?...) are internal redirects and cannot be used directly as magnet linksGet the real magnet link:
infoUrl or guid pointing to Nyaa (e.g. https://nyaa.si/view/123456), extract the ID and fetch from Nyaacurl -sL "https://nyaa.si/view/<id>" and extract the magnet link with: grep -oP 'magnet:\?xt=urn:btih:[^"]+' | head -1Add to qBittorrent:
curl -s -c /tmp/qbt_cookies.txt "http://localhost:8081/api/v2/auth/login" -d "username=admin&password=adminadmin"curl -s -b /tmp/qbt_cookies.txt "http://localhost:8081/api/v2/torrents/add" --data-urlencode "urls=<magnet_link>" -d "category=<category>"tv for series, movies for films, ebooks for booksrm -f /tmp/qbt_cookies.txtVerify: Wait a few seconds, then check the torrent was added:
curl -s -b /tmp/qbt_cookies.txt "http://localhost:8081/api/v2/torrents/info" and filter for the new torrenttv category is what Sonarr monitors for auto-importmovies category is what Radarr monitors for auto-import--data-urlencode for the magnet URL to handle special charactersssh -i ~/.ssh/id_ed25519_homeserver 192.168.1.117