Skip to content

Instantly share code, notes, and snippets.

@pwmckenna
Created November 10, 2012 00:45
Show Gist options
  • Save pwmckenna/4049280 to your computer and use it in GitHub Desktop.
Save pwmckenna/4049280 to your computer and use it in GitHub Desktop.
torque add torrent callback possibilities
var request = app.btapp.get('torrent').download({
url: 'magnet:?xt=urn:btih:D075D45EA1DA3E20BA148A08D984EFFC439273A4',
callback: function() {
// torrent has been added to the torrent list of the client.
// this is called immediately on magnet links,
// but might take a bit for http://*.torrent file urls
}
});
request.then(function(res) {
// the client has heard and acknowledged your request
}, function(res) {
// awwww shit
});
request.done(function(res) {
// I only care about success!
});
request.fail(function(res) {
// I only care about failure!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment