Jump to content

Load a .torrent file


Recommended Posts

Hello I would like to know if someone can help to write a script to load .torrent files.

when i was using mldonkey I had created this script to simply load torrent, I was wondering if someone know the argument to load a .torrent file from the computer using the webUI.



# Script to be called by web browser to load torrents to mldonkey


# Created by Neub


# This is setup for mldonkey running as daemon process as

# user mldonkey. As configured by mldonkey-init.




echo "google-chrome http://$user@$server:$port/submit?jvcmd=multidllink&links=$1"

google-chrome "http://$server:$port/submit?jvcmd=multidllink&links=$1"


Another question Is that It might be more interesting to use magnet link but I have no idea to make it work with uTorrent.

Link to comment
Share on other sites

The easiest way to "load" a torrent file is to put it in the autoload directory :)

Just quickly, I can offer this script that sends a URL (magnet link or file URL) to utserver:


rm ~/.utorrent/curl.sh 2> /dev/null

# Get token
export token=$(curl -G -s -c ~/.utorrent/ucookie.txt -n|sed 's/<[^<>]*>//g')
# echo $token

# Add URL
curl -G -s -n -b ~/.utorrent/ucookie.txt -d token=$token -d action=add-url -d s="$1"

It is also possible to send the actual contents of an existing file directly to utserver in the same way. I haven't tested this so I don't post the exact command, but you would need to use the --form option to curl in order to pass a form field name of type "file" and name "torrent_file" with a value of the filename to be loaded. The action is add-file instead of add-url. Possibly the command would be this (untested!):

curl -G -s -n -b ~/.utorrent/ucookie.txt -d token=$token -d action=add-file -F torrent_file=@/home/you/whatever.torrent

P.S. I can't see the full width of the code lines in my browser. I hope you can.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...