neub Posted May 7, 2011 Report Share Posted May 7, 2011 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.#!/bin/bash## 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.user=adminserver=neubserverport=8080echo "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 More sharing options...
lithopsian Posted May 7, 2011 Report Share Posted May 7, 2011 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:#!/bin/bashrm ~/.utorrent/curl.sh 2> /dev/null# Get tokenexport token=$(curl -G -s -c ~/.utorrent/ucookie.txt -n http://192.168.0.4:9091/gui/token.html|sed 's/<[^<>]*>//g')# echo $token# Add URLcurl -G -s -n -b ~/.utorrent/ucookie.txt -d token=$token -d action=add-url -d s="$1" http://192.168.0.4:9091/gui/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 http://192.168.0.4:9091/gui/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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.