add trans-add script to repo that will add new torrents to

transmission-daemon remote or local
master
alex 2022-09-25 01:53:44 -05:00
parent 9180c21522
commit 4996192f43
3 changed files with 57 additions and 4 deletions

View File

@ -2,7 +2,7 @@
while :
do
echo "pressing shift key."
wtype -M shift -m shift
wtype -d 1000 caffeine
wtype -d 1000 -k return
sleep 60
done

55
trans-add Executable file
View File

@ -0,0 +1,55 @@
#!/usr/bin/env sh
#to use remote option add to .profile:
# export TRNS_IP=REMOTE TRANSMISSION IP
ARGS="$@"
IP="127.0.0.1"
DIR="$TRNS_DL_DIR"
help() {
echo "add a torrent to a currently running transmission-daemon, requires that transmission-daemon is running on this machine, or on a server, and that"
echo " the current machine has the program transmission-remote installed. If using remote option, ensure the remote daemon config has your local machine's"
echo " IP address added to it's whitelist"
echo ""
echo " If adding a torrent locally (without -r), the script trans-init will be called to initialize the transmission-daemon on the local machine if it is not already running"
echo ""
echo "usage:"
echo " trans-add URL -> add magnet link to transmission-daemon running on local machine"
echo " trans-add -r URL -> add magnet link to transmission-daemon running on remote machine, IP address is defined by \$TRNS_IP environment variable"
echo " trans-add -r URL path/to/directory/ -> add magnet link to transmission-daemon running on remote machine, set download dir to be path defined by \$TRNS_DL_DIR/path/to/directory"
echo " trans-add URL path/to/directory/ -> add magnet link to transmission-daemon running on local machine, set download dir to be path defined by \$TRNS_DL_DIR/path/to/directory"
echo " trans-add FILE -> add .torrent file to transmission-daemon running on local machine"
echo " trans-add -r FILE -> add .torrent file to transmission-daemon running on remote machine"
echo " trans-add -h -> display this help message"
echo ""
exit
}
[ "$#" = "0" ] && help
[ "$1" = "-h" ] && help
[ "$1" = "--help" ] && help
if [ "$1" = "-r" ]; then
ARGS="$2"
IP="$TRNS_IP"
echo "============================="
echo "$ARGS"
echo "============================="
if [ "$3" ]; then
DIR="$DIR/$3"
fi
else
trans-init
if [ "$2" ]; then
DIR="$DIR/$2"
fi
fi
RSP="$(transmission-remote "$IP":9091 -a "$ARGS" -w "$DIR" )"
notify-send "trans-add remote:" "adding: $RSP"

View File

@ -6,8 +6,6 @@
while [ ! -f ~/.cache/transmission/bt_blocklists.gz ]; do
sleep 10
cd ~/.cache/transmission/
#curl -O -L https://github.com/sahsu/transmission-blocklist/releases/download/1.0.0/blocklist.gz
#curl -O -L https://github.com/sahsu/transmission-blocklist/releases/latest/download/blocklist.gz
curl -O -L https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz
done