lithopsian Posted January 5, 2011 Report Share Posted January 5, 2011 I'm having some troubles with adding torrents through the web API. It seems to affect file URLs but not magnet link URLs, and is almost certainly related to a flaky server being slow or refusing some requests. btmon.com is the main culprit at the moment. I don't think I've ever seen this with pirate bay which can also be pretty flaky.I send an addUrl command through the API, using the webui or other tools I've developed. The API says OK by sending back its build ID. Then nothing happens, the torrent never appears. When accessing the torrent server directly, it will sometimes take a long time to send me the file and sometimes return a 5xx error.Can this behaviour be improved? Should the API wait a second or two before confirming? Link to comment Share on other sites More sharing options...
Lord Alderaan Posted January 5, 2011 Report Share Posted January 5, 2011 Error reporting is lacking. The API usually returns it's build, even if a request wasn't processed correctly/completely. Link to comment Share on other sites More sharing options...
Ultima Posted January 6, 2011 Report Share Posted January 6, 2011 The API isn't saying that the torrent was added. The backend is just saying that it received the add-url request and processed it.There's no way to always correctly and synchronously return the status of an added URL when there's no way to predict when/if the server will ever respond. Waiting a second or two isn't a proper solution (probably not even a good workaround). At best, there needs to be a separate way to keep track of added URLs -- whether by some separate request, or some additional information in /gui/?list=1, and perhaps with some token returned by add-url. Link to comment Share on other sites More sharing options...
lithopsian Posted January 6, 2011 Author Report Share Posted January 6, 2011 Thinking about that, am I right that there isn't a really good way to tie in a /gui/?list=1 entry to an add URL request? That would be handy. Link to comment Share on other sites More sharing options...
Ultima Posted January 6, 2011 Report Share Posted January 6, 2011 Actually, I forgot that the current (µTorrent v3.0) /gui/?list=1 already does return the URL by which a torrent was added (index 19 into the torrent job detail array).In most cases, that should work just fine. The only problem that might arise is if the server happens to reuse a URL to serve different .torrent files, in which case you'd be out of luck trying to figure out which of the several torrents that may be using that particular URL is the actual torrent you're looking for. Link to comment Share on other sites More sharing options...
lithopsian Posted January 9, 2011 Author Report Share Posted January 9, 2011 I see it! I'll look into using that to check on the success of an add-url request. And maybe finding a subtle way of flagging up an error 30 seconds after I claimed the torrent was added ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.