Last active
January 30, 2025 00:58
-
-
Save tree-s/1b2177bac1d8f2b70fac9e235a7f262c to your computer and use it in GitHub Desktop.
--curl new torrents to a transmission web daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
test -z $1 && echo "need magnet link! | |
$0 <magnet link>" && exit -1 | |
HOST=YourRemoteHostNameOrIP | |
PORT=YourPort(default is 9091) | |
USER=User | |
# NOTE: I had issues using passwords with semicolons (;) in them, | |
# you might want to stay away from them | |
PASS=pass | |
LINK="$1" | |
# set true if you want every torrent to be paused initially | |
#PAUSED="true" | |
PAUSED="false" | |
SESSID=$(curl --silent --anyauth --user $USER:$PASS "http://$HOST:$PORT/transmission/rpc" | sed 's/.*<code>//g;s/<\/code>.*//g') | |
curl --silent --anyauth --user $USER:$PASS --header "$SESSID" "http://$HOST:$PORT/transmission/rpc" -d "{\"method\":\"torrent-add\",\"arguments\":{\"paused\":${PAUSED},\"filename\":\"${LINK}\"}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No problem glad it was of some use!