transmission-remote-magnet 335 B

1234567
  1. #!/bin/bash
  2. # transmission-remote-magnet
  3. # Usage: transmission-remote-magnet <magnet URL>
  4. [ -z "$1" ] && exit 1
  5. SESSID="$(curl -sI http://localhost:9091/bt/rpc/ | grep 'X-Transmission-Session-Id' | tr -d '\r')"
  6. curl -s -H "$SESSID" -d "{\"method\":\"torrent-add\",\"arguments\":{\"filename\":\"${1}\"}}" http://localhost:9091/bt/rpc