Jump to content

API says torrent was added, but it wasn't


lithopsian

Recommended Posts

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

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

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

Archived

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

×
×
  • Create New...