You are not logged in.
I've just begun using rTorrent and I like it a lot, especially the feature where you can set up a directory for it to watch and have it start/stop downloads in torrents in that directory.
I am however having a bit of a problem getting Firefox to behave nicely with this. The "watch" dir isn't the same as the default download dir, and there is no option in Firefox to save *.torrent files in a specific dir.
I tried working around this by writing a small bash script that takes one argument and saves it in the "watch" dir, like so:
#!/bin/bash
wget -P "path_to_watch_dir" $1
and making Firefox execute it upon encountering *.torrent files, but then Firefox decides to download all *.torrent files to /tmp. The script works fine, both then run with the intended .torrent file as an argument and when the command is simply run in the shell, so I figure this is a problem with how Firefox passes arguments to scripts/programs.
Any thoughts on how to solve this problem? Should I maybe just take the easy way out and make the "watch" dir the same as the default download dir?
Offline
Offline
Thanks, but this doesn't quite work, see here:
http://dlstatusbar.proboards43.com/inde … 1174478065
Apparently there's a problem with torrent sites using redirected links, so this whole idea might be a bit more complicated than I originally thought.
Offline
Just move firefox out of the equation and make a script that watches your download dir for files that end in ".torrent" and have it move them to your watched dir.
Offline
This is the most elegant way i know of to solve these problems: http://bbs.archlinux.org/viewtopic.php?id=37406
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
Thanks jellywerker and test1000, incrond and a simple bash script have taken care of things.
It didn't even cross my mind to do this without firefox. Some nerd I am.
Offline
I actually just save a little bookmark in the gnome dialog thinger (whatever it's called) to my torrents dir, then make it save to disk every time. Easy enough for me, but the script idea is a good one.
PS you can use the MimeEdit firefox extension to force the action to a script if you like
Offline
Just say yes
Offline
here is the script i use:
it just copy the first argument passed to the script by the browser to your watchdir.
whatch out my filesystem encoding is utf8
#!/bin/sh
#
# this script copies the torrent file passed as arguments to the directory
# watch_dir where rtorrent watches for new torrents
#
# to be used by your browser i.e. point your browser to rtorrent.sh and not
# toward rtorrent !
# ~ does not seem to work today. WHY ?
if [ -z "$HOME" ] ;then
HOME="/home/`whoami`"
fi
# exec >>$HOME/rtorrentsh.log 2>&1
if [ -z "$1" ] ;then
exit 1
fi
src="$1"
if [ ! -f "$src" ] ;then
# opera passes the filename in latin1 encoding but my filesystem is in utf8
src=`echo $1|iconv -f latin1 -t utf8`
if [ ! -f "$src" ] ; then
echo "rtorrent.sh: $1 file not found" >&2
exit 1
fi
fi
# your watch directory defined in .rtorrent.rc
watch_dir="$HOME/.rtorrent/watch"
cp "$src" "$watch_dir"
unset watch_dir torrent src
Offline