Jump to content

Does anybody know how to write a submit script ?


funicorn

Recommended Posts

Here is a snippet of shell script that will add a URL (magnet link or file on the web). You could write a similar one using add-file for a file you have already downloaded. You can associate the script with the relevant file or protocol in your web browser. The only reason it is more than a one-liner is to implement token auth. The URL is the first shell script parametr, appearing as $1. Username and password should be configured in .netrc, or you could hardcode them into the script.

# Get token
export token=$(curl -G -s -c ~/.utorrent/ucookie.txt -n http://192.168.0.4:8080/gui/token.html|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" http://192.168
.0.4:8080/gui/

This Firefox extension will also submit URLs to utserver and has the benefit of feedback to the user if the submit fails for some reason such as utserver not running:

https://addons.mozilla.org/en-US/firefox/addon/244867/

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...