Jump to content

iPhone uTorrent WebUI (Fijian Warrior Edition)


fijian-warrior

Recommended Posts

  • 2 weeks later...
  • 2 weeks later...

NOTE: There are 2 separate hacks in this post, one enables this UI to work on private sites that require cookie information and the other enables changing the global upload and download rate.

when I get time I will be coming up with a hack to show the current speed limits in the status bar at the top.

Here is how I modified this excellent mobile UI (I use it on my Palm Pre and it works great there too).

I wanted to be able to have it download torrents from some private sites that I am a member of. You have to include cookie information with these private sites in order for it to work. Here is the change needed.

The file to edit is .\iphone\scripts.js starting on line 784 you will find

function add() {
reloadToken();
var torrenturl = prompt("Mininova Torrent ID or URL", "");

if (torrenturl.search("http") < 0)
{
torrenturl = "http://www.mininova.org/get/" + torrenturl;
}


var url = "/gui/?token="+token+"&action=add-url&s=" + torrenturl;
asyncRequest('GET', urlprefix+url, function(o) {updateData();});
}

you just want to add in a few extra lines to automatically add in the required cookie information if the torrent comes from a private site. I will use my favorite site trackeraccess.org for an example. You want to add in this code:

    if (torrenturl.search("trackeraccess") > 0)
{
torrenturl = torrenturl + ":COOKIE:c_secure_uid=YOURCOOKIEINFO;c_secure_pass=YOURCOOKIEINFO";
}

obviously replace the parts that say YOURCOOKIEINFO with... well... your cookie info. The whole thing when modified will look like this:

function add() {
reloadToken();
var torrenturl = prompt("URL / Mininova ID /TA URL", "");

if (torrenturl.search("http") < 0)
{
torrenturl = "http://www.mininova.org/get/" + torrenturl;
}

if (torrenturl.search("trackeraccess") > 0)
{
torrenturl = torrenturl + ":COOKIE:c_secure_uid=YOURCOOKIEINFO;c_secure_pass=YOURCOOKIEINFO";
}

var url = "/gui/?token="+token+"&action=add-url&s=" + torrenturl;
asyncRequest('GET', urlprefix+url, function(o) {updateData();});
}

I also changed the text it prompts you with to remind me that it works with that private site. This is a change that each person will have to make on their own since the information required from the cookies will vary for each user. Make sure that the text in the 'if (torrenturl.search(" line is something that will be found in the URL if the torrent is from that private site.

To get the cookie info you can use a firefox addon called 'view cookies' to make it really easy, or you can just look at the cookie manually.

If anyone has any questions or need some help on how to do this just ask and I will see if I can help you out. I am subscribed to the topic so I should get an email if you reply asking a question.

------------------------------------------------------------------------

ANOTHER HACK:

I would have put this in a separate post, but the forums won't let me since it would be a double post

------------------------------------------------------------------------

Here is another hack I just worked out for this excellent UI (I am just adding functionality that I would like so I am not going to be taking over or anything and it is up to fijian-warrior to integrate this one into it himself.

I was missing the ability to change the global upload and download rate from my phone. If my wife calls me complaining that the internet is going too slow because of my torrents my only option with this UI is to pause or stop them completely or to limit the speeds of the torrents one by one. Here is how you can add in global rate changes.

First open the .\iphone\style.css file and on line 445 you will find:

#options a.r_resume {
background: #fff url('play-big.png') no-repeat 0 0;
}

insert this just after it

#options a.r_upload {
background: #fff url('uploading.png') no-repeat 0 0;
}

#options a.r_download {
background: #fff url('downloading.png') no-repeat 0 0;
}

so it will look like this all together

#options a.r_resume {
background: #fff url('play-big.png') no-repeat 0 0;
}

#options a.r_upload {
background: #fff url('uploading.png') no-repeat 0 0;
}

#options a.r_download {
background: #fff url('downloading.png') no-repeat 0 0;
}

next open the .\iphone\globalVars.js file and on line 156-160 you will find

        '<div class="optionsRow">' +
'<div class="optionsCell optionsCellHeader">Pause/Resume</div>' +
'<div class="optionsCell optionsCellButton"><a class="r_pause r_general" href="#" onClick="javascript:globalPauseResume(1); return false;"></a></div>' +
'<div class="optionsCell optionsCellButton"><a class="r_resume r_general" href="#" onClick="javascript:globalPauseResume(2); return false;"></a></div>' +
'</div>' +

insert after that

        '<br/>' +
'<div class="optionsRow">' +
'<div class="optionsCell optionsCellHeader">Global Speeds</div>' +
'<div class="optionsCell optionsCellButton"><a class="r_download r_general" href="#" onClick="javascript:changeGlobalDownloadRate(); return false;"></a></div>' +
'<div class="optionsCell optionsCellButton"><a class="r_upload r_general" href="#" onClick="javascript:changeGlobalUploadRate(); return false;"></a></div>' +
'</div>' +

so all together it will look like (with a few lines after as well so you make sure to get it right)

        '<div class="optionsRow">' +
'<div class="optionsCell optionsCellHeader">Pause/Resume</div>' +
'<div class="optionsCell optionsCellButton"><a class="r_pause r_general" href="#" onClick="javascript:globalPauseResume(1); return false;"></a></div>' +
'<div class="optionsCell optionsCellButton"><a class="r_resume r_general" href="#" onClick="javascript:globalPauseResume(2); return false;"></a></div>' +
'</div>' +
'<br/>' +
'<div class="optionsRow">' +
'<div class="optionsCell optionsCellHeader">Global Speeds</div>' +
'<div class="optionsCell optionsCellButton"><a class="r_download r_general" href="#" onClick="javascript:changeGlobalDownloadRate(); return false;"></a></div>' +
'<div class="optionsCell optionsCellButton"><a class="r_upload r_general" href="#" onClick="javascript:changeGlobalUploadRate(); return false;"></a></div>' +
'</div>' +
'<br/>' +
'<div id="h2">Filters & Sorting</div>' +
'<div id="torrentsOrderTableIntro">Use the arrows to change the status order and tap the faces to show or hide a status!</div>' +

And for the last file to edit we head over to .\iphone\script.js we are going to be editing this one in 2 places.

first at lines 784-794 (the same function as before) you will find (yours may vary if you used my hack from above)

function add() {
reloadToken();
var torrenturl = prompt("Mininova Torrent ID or URL", "");

if (torrenturl.search("http") < 0)
{
torrenturl = "http://www.mininova.org/get/" + torrenturl;
}
var url = "/gui/?token="+token+"&action=add-url&s=" + torrenturl;
asyncRequest('GET', urlprefix+url, function(o) {updateData();});
}

after this function you want to add the new checknumber function and the new functions to change the global rates.

function checknumber(value){
var x=value
var anum=/(^\d+$)|(^\d+\.\d+$)/
if (anum.test(x))
testresult=true
else{
alert("Please input a valid number!")
testresult=false
}
return (testresult)
}

function changeGlobalDownloadRate() {
reloadToken();
var DownloadRate = prompt("Please enter the new global download rate('0' is unlimited!)", "");
checknumber(DownloadRate)
var url = "/gui/?token="+token+"&action=setsetting&s=max_dl_rate&v="+DownloadRate;
asyncRequest('GET', urlprefix+url, function(o) {loadFiles(hash);});
}

function changeGlobalUploadRate() {
reloadToken();
var DownloadRate = prompt("Please enter the new global upload rate('0' is unlimited!)", "");
checknumber(DownloadRate)
var url = "/gui/?token="+token+"&action=setsetting&s=max_ul_rate&v="+DownloadRate;
asyncRequest('GET', urlprefix+url, function(o) {loadFiles(hash);});
}

so all together it will look like this (on a copy without my previous hack, yours may vary if you used the private tracker hack from earlier)

function add() {
reloadToken();
var torrenturl = prompt("Mininova Torrent ID or URL", "");

if (torrenturl.search("http") < 0)
{
torrenturl = "http://www.mininova.org/get/" + torrenturl;
}
var url = "/gui/?token="+token+"&action=add-url&s=" + torrenturl;
asyncRequest('GET', urlprefix+url, function(o) {updateData();});
}

function checknumber(value){
var x=value
var anum=/(^\d+$)|(^\d+\.\d+$)/
if (anum.test(x))
testresult=true
else{
alert("Please input a valid number!")
testresult=false
}
return (testresult)
}

function changeGlobalDownloadRate() {
reloadToken();
var DownloadRate = prompt("Please enter the new global download rate('0' is unlimited!)", "");
checknumber(DownloadRate)
var url = "/gui/?token="+token+"&action=setsetting&s=max_dl_rate&v="+DownloadRate;
asyncRequest('GET', urlprefix+url, function(o) {loadFiles(hash);});
}

function changeGlobalUploadRate() {
reloadToken();
var DownloadRate = prompt("Please enter the new global upload rate('0' is unlimited!)", "");
checknumber(DownloadRate)
var url = "/gui/?token="+token+"&action=setsetting&s=max_ul_rate&v="+DownloadRate;
asyncRequest('GET', urlprefix+url, function(o) {loadFiles(hash);});
}

here is a screen cap from my Pre showing what it should look like if you do it correctly.

browser_2009-01-11_195131.jpg

If anyone has any questions or need some help on how to do this just ask and I will see if I can help you out. I am subscribed to the topic so I should get an email if you reply asking a question.

Link to comment
Share on other sites

Hi cryptk,

this is awesome work, thanks for putting the effort in. I'm having some problems adding the cookie info to allow adding torrents from private trackers. I followed your instructions to a t but keep getting the 'invalid passkey' message on my desktop client.

The only things i can think of are:

1) My scripts.js file, as downloaded from fijian-warrior's site differs slightly from what you have.

instead of

function add() {

reloadToken();

var torrenturl = prompt("URL / Mininova ID /TA URL", "");

it reads

function add() {

reloadToken();

var torrenturl = prompt("Mininova Torrent ID or URL", "");

2) the other thing is, when i look at the cookie info in firefox using view cookies, the value under "secure" is "no". not sure if either of these things are issues.

Any help would be greatly appreciated!

Thanks!

Link to comment
Share on other sites

Hi Guys,

I'm about to release a new version that will incorporate the global upload/download hack that is described above, with some bug fixes and improvements. Also, I have a new 'Add a torrent' panel coming with integrated RSS from mini nova.

nandocalhoun - I'm working on a solution for private tracker sites so keep an eye on my website.

Regards

Link to comment
Share on other sites

nandocalhoun

that line being different isn't causing the problem. That is just the text is uses at the prompt and I added in the privat sites I made it work with on my uTorrent...

Chances are you are using the wrong cookie data.

Fijian, Thanks for integrating my hacks into the product!

Link to comment
Share on other sites

lol

ok sorry, check my website. I have a download button on the top right with 2 different mirror sites.

:)

New update:

iphone-web-ui-fwe-v0-0-4.png

- New sorting option for within the same torrent status

- Release number now in footer

- Improvements to the 'Add URL' panel (Support for more torrent sites, plus temporary private tracker solution)

- Minor Bug fixes

For more information and download links please click here...

Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...

What do you mean by uRemote?

You should browse to the webui using Safari. As explained by Fijian Warrior on his blog:

You must have uTorrent WebUI installed first before you can install my iPhone WebUI edition. Instructions can be found here and here .

Now download the zip found above top right of my site, extract it, inside there is a folder called 'iphone' take that folder and place it inside the webui.zip that you installed in at '%AppData%\uTorrent' on your PC. Don't extract the webui zip just add the iphone folder to it.

Next on your iPhone go to the URL of your uTorrent WebUI adding /iphone/(ie http://YOURIP:PORT/gui/iphone/i.html), enter your username / password you should now see all your torrents.

Link to comment
Share on other sites

  • 1 month later...

Archived

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

×
×
  • Create New...