Add Torrents To wTorrent (v2.6)

By Shannon Brooks Last update Nov 3, 2011 — Installed 2,508 times.

Add download dir functionality

in
Subscribe to Add download dir functionality 1 post, 1 voice

ssmy User

I modified the script a bit to add the functionality to choose the download dir (mine kept donwloading into my home, not my home dir /torrents). IT adds the about:config variable wTorrent_Download_Dir. Here are the parts that I changed:
...
// wTorrent FQDN or IP
var host = GM_getValue("wTorrent_FQDN","wtorrent") ;
// wTorrent Port (if not 80)
var port = GM_getValue("wTorrent_Port","80");
// wTorrent Username
var username = GM_getValue("wTorrent_User","");
// wTorrent Password
var password = GM_getValue("wTorrent_Pass","");
// Download dir
var download_dir = GM_getValue("wTorrent_Download_Dir","");

// init variables in firefox about:config
if (GM_getValue("wTorrent_FQDN") == undefined) {
GM_setValue("wTorrent_FQDN","wtorrent");
GM_setValue("wTorrent_Port","80");
GM_setValue("wTorrent_User","");
GM_setValue("wTorrent_Pass","");
GM_setValue("wTorrent_OverRideCheck",false);
GM_setValue("wTorrent_OverRideCheck","");
GM_setValue("wTorrent_Download_Dir","");
}
...
// here we actually send the form data with the torrenturl
post('http://'+host+port+'/index.php?cls=AddT', 'torrenturl='+encodeURIComponent(wTorrentLink.href)+'&start_now=on&download_dir='+download_dir, function(s) {
...

Hopefully you will see fit to include this in the script. I find it quite useful. My entire version of the script is here: http://pastebin.com/f2920561 in case that would be useful.

Thanks for the awesome script!

ssmy

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel