Create script to seed torrent

dsouvik215

Member
May 25, 2018
896
0
16
Hi everyone,
I've installed ruTorrent on my dedicated server with debian lenny and lighttpd. I've been trying to make a script that add a torrent file pointing to a file I have in the server, and start seeding it. The idea is to run the script on a specific folder that has all the files I want to seed, and start seeding them.
I've tryed everything, from call the addTorrent.php file to make a cURL to that file, and nothing works..
The folder where the ruTorrent is installed, is blocked by a password, so only authorized users can access..
I'm not an addvance debian user, and I never use lighttpd.

I want to know if someone has a script that does what i want to do, or has an idea of how can I make the script.

Thanks in advance,

pd. sorry my english, I hope you can understand me smiley.gif
 

Attachments

lisas4567

Member
May 25, 2018
773
0
16
This works. You need http://code.google.com/p/pyroscope/wiki/CliUsage#rtxmlrpc and http://code.google.com/p/pyroscope/wiki/CliUsage#mktor

#! /bin/bash
set -e

if test $# -lt 1; then
echo "Usage: $(basename $0) «directory»"
exit 1
fi

tracker=....
local_watch=/var/torrent/watch
upload_meta=/var/torrent/uploads
priority=2

fail() {
echo >&2 "$@"
exit 1
}

DRY=""
if test "$1" = "-n"; then
DRY=echo
shift
fi

dir="$1"

test -d "$dir" || fail "$dir doesn't exist!"
dir=$(cd "$1" && pwd)

#set -x
metafile="/tmp/$(basename "$dir" | sed -re 's/[^-_a-zA-Z0-9]+/./g' -e 's/\.$//')"
$DRY mktor -pH -o "$metafile.torrent" "$dir" $tracker
$DRY mv "$metafile.torrent" "$upload_meta"
$DRY mv "$metafile-resume.torrent" "$local_watch/$(basename $metafile).torrent.loaded"
$DRY rtxmlrpc -v load.verbose '' "$local_watch/$(basename $metafile).torrent.loaded" \
"d.directory_base.set=\"$dir\"" "d.priority.set=$priority"
 

dsouvik215

Member
May 25, 2018
896
0
16
Hi again,
I was trying to make the script work, but it doesn't..
The error is something that it cannot move the file test.torrent because it isn't on /tmp/test.torrent
I am not able to read and understand the script, so, I have no idea where the file should be.

I hope you can help me by describing what the script should do.

Thanks in advance! smiley.gif
 

Attachments