liquidx Posted September 14, 2008 Report Share Posted September 14, 2008 Hello, I'm wondering if someone can tell me the best way to go about stopping / starting all torrents through the Web UI API?What my goal is is to have an automated script which is able to pause and resume all the torrents on certain events (freeing up bandwidth), one example of use would be to pause torrents when a voip call comes in.The only thing I need to know is how to stop all / start all torrents. Link to comment Share on other sites More sharing options...
Ultima Posted September 14, 2008 Report Share Posted September 14, 2008 Get the list of torrents using ?list=1, then loop through all of the torrents, grab the hash, and use action=stop&hash=[torrent hash] on each hash. Or ?action=start&hash=[torrent hash] to start. Link to comment Share on other sites More sharing options...
Directrix Posted September 14, 2008 Report Share Posted September 14, 2008 You'll be able to do this in one request. ?action={start,stop}&hash=ABCDEF0...&hash=ACBDEF1...&hash=ABCDEF2...I haven't tried this yet, but I would expect µTorrent to handle any number of hashes (1000+)...cross your fingers and fire off the request. Link to comment Share on other sites More sharing options...
Ultima Posted September 14, 2008 Report Share Posted September 14, 2008 The only potential problem with that is that the library used to send the request might also limit the URL/request length. For example, WinINet has a ~2000 character (or was it byte?) limit.I suppose one could configure how many torrents they'd like to coalesce into one request, and that way, it'd send Ceiling((total # torrents)/(# torrents per request)), still eliminating at least some of overhead. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.