NanaBonana Posted January 12, 2010 Report Share Posted January 12, 2010 I checked before I ran the script with php_info(); and I have this:cURL Information: libcurl/7.19.4 OpenSSL/0.9.8i zlib/1.2.3 libidn/0.6.5Does it matter that my server is running linux? Link to comment Share on other sites More sharing options...
gugahoi Posted April 15, 2011 Report Share Posted April 15, 2011 Is this code still supposed to work? I'm getting errors all around!$torrent = new uTorrent('localhost','9050','admin','1234');$build = $torrent->getBuild();echo $build;Doesn't seem to do anything. What am I missing here? Link to comment Share on other sites More sharing options...
WildTangent Posted May 5, 2011 Report Share Posted May 5, 2011 Does anybody have a current version of the code? (Contributed hacks and admin ghost-edits included) Link to comment Share on other sites More sharing options...
Ultima Posted May 8, 2011 Report Share Posted May 8, 2011 http://forum.utorrent.com/viewtopic.php?pid=320049#p320049 Link to comment Share on other sites More sharing options...
_Mikie_ Posted June 26, 2011 Report Share Posted June 26, 2011 Could some update the original examples to work with tokens?Thanks Link to comment Share on other sites More sharing options...
Eric Muyser Posted June 27, 2011 Report Share Posted June 27, 2011 Could some update the original examples to work with tokens?ThanksThis code may help whomever does: https://github.com/ericmuyser/utorrent-php-api/blob/master/src/utorrent.php#L240 Link to comment Share on other sites More sharing options...
Ultima Posted June 28, 2011 Report Share Posted June 28, 2011 The latest version of the API already has rudimentary token support. There isn't anything you need to do explicitly to support it if you just use the constructor. And if you're not using the constructor... well, just look at how the constructor is setting up the token, and the rest will take care of itself. Link to comment Share on other sites More sharing options...
NTrix Posted February 25, 2012 Report Share Posted February 25, 2012 hey Ultima, I have a problem with your tweaked script.I copied your script without any changes and when I try to make it login or doing any other actionsI always get this error 'could not get token'.I made sure of course that the auth_token is enabled.Do you have any idea why it happens?Edit:Oh, oops i fix that problem. But now there's a strange problem..When the auth_token is enabled when I try to use the 'getTorrents' function i get this error:Warning: Invalid argument supplied for foreach() in...But when I set the webui.token_auth to FALSE, it works fine.This is how I call to this function:$torrents = $torrent->getTorrents();it's not getting a thing.Unless of course I'm using this function not the way it should be used.After I'm doing this: $torrents = $torrent->getTorrents();I'm running a foreach like that:foreach($torrents as $torrent1) { echo $torrent1[UTORRENT_TORRENT_NAME] . "<br>";}Is that's how it should be?Another Edit:I understand that there is now a new method of verifications. Used by cookies, right?Is there a way to implement it in this script? Link to comment Share on other sites More sharing options...
Ultima Posted February 25, 2012 Report Share Posted February 25, 2012 Perhaps cookies are indeed screwing things up. I'm not familiar enough with PHP/curl to be able to say how much effort it'd be, but I doubt it would be too bad, assuming curl allows you to get/set the connection's cookie details. The only thing that would need to be done is for the cookie to also be stored alongside the token when the token is being retrieved, and then have the library attach that cookie to every request it sends. Link to comment Share on other sites More sharing options...
NTrix Posted February 25, 2012 Report Share Posted February 25, 2012 Perhaps cookies are indeed screwing things up. I'm not familiar enough with PHP/curl to be able to say how much effort it'd be, but I doubt it would be too bad, assuming curl allows you to get/set the connection's cookie details. The only thing that would need to be done is for the cookie to also be stored alongside the token when the token is being retrieved, and then have the library attach that cookie to every request it sends.Oh, I see.Question is, on what base this cookie get it's value?Need to know what value to set for this cookie for it to work.Yeah, seems like pain in the ass Link to comment Share on other sites More sharing options...
Ultima Posted February 25, 2012 Report Share Posted February 25, 2012 As I said, you get the cookie from the connection when you retrieve the token. µTorrent will give you a cookie; all you need to do is send that back on every request after. Link to comment Share on other sites More sharing options...
NTrix Posted February 25, 2012 Report Share Posted February 25, 2012 As I said, you get the cookie from the connection when you retrieve the token. µTorrent will give you a cookie; all you need to do is send that back on every request after.Yes, but...I checked that. When i use that PHP class for example to gain access to the webui using cURL,and after i removed the cookie it created back then, it won't create it again when it's using cURL(If I understood right from your message). Link to comment Share on other sites More sharing options...
harisha Posted October 13, 2013 Report Share Posted October 13, 2013 Not sure if anyone still uses this or not but I figured I'd let you know I've made some improvements and added some functionality to this library.https://github.com/tboothman/utorrent-php-apiFor whatever reason a cookie is needed as well as the token when used remotely so I've added in the code to support that.I've added in RSS filter functionality which lets you retrieve, update and add new filters.Added composer support, because .. it's awesome.I assume no-one else is maintaining this code? Couldn't find it elsewhere on github and this seems to be the last reference to it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.