How to list all torrents by http request ?

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
Post Reply
aibo99
Posts: 6
Joined: Tue Jan 06, 2009 4:30 am

How to list all torrents by http request ?

Post by aibo99 »

Hello,

I want to list all torrents by http request.

I have checked the RPC specification (http://trac.transmissionbt.com/browser/ ... c-spec.txt), but could not find the "list all torrents" method.

I tried this - http:// hostname:9091/transmission/rpc?method=torrent-get , but it returns "no fields specified"

Q1. What field(s)/values(s) should I use to list all torrents ?

Q2. Can I use XML-RPC to send the request ?

Thanks
enriqueaf
Posts: 3
Joined: Wed Jan 07, 2009 11:19 am

Re: How to list all torrents by http request ?

Post by enriqueaf »

I don't know how to make the URL for ask for the torrents, but transmission-remote use the RPC and you can get the list of the torrents. For see what transmission-remote use you can use:
transmission-remote --debug -l
I hope it helps you
Enrique
Gimp
Web Interface Developer
Posts: 257
Joined: Mon Mar 12, 2007 3:49 am
Location: BC, Canada

Re: How to list all torrents by http request ?

Post by Gimp »

?method=torrent-get&fields=name,status

where fields= contains any keys you wish to return. see the list of keys under 3.3 at the link you provided.
aibo99
Posts: 6
Joined: Tue Jan 06, 2009 4:30 am

Re: How to list all torrents by http request ?

Post by aibo99 »

Gimp wrote:?method=torrent-get&fields=name,status

where fields= contains any keys you wish to return. see the list of keys under 3.3 at the link you provided.
Hi,

I tried your URL (... transmission/rpc?method=torrent-get&fields=name,status), but it still returns error as below.

{
"arguments": {
"torrents": []
},
"result": "no fields specified"
}

What should I do ? :|

Thanks
crh0872
Posts: 1
Joined: Wed Feb 18, 2009 2:36 am

Re: How to list all torrents by http request ?

Post by crh0872 »

{
"arguments": {
"torrents": []
},
"result": "no fields specified"
}
Same problem here. I've read and re-read rpc-spec.txt, and "fields" is just another argument, so it would be defined by &fields= just as speed-limit-down is an argument and is set via &speed-limit-down=50 with no problem. If I don't get any other help I may open up a bug report or feature request, not sure which to file, heh. Maybe arrays need to be sent via the GET URL differently?

My URL is as follows:

localhost:9091/transmission/rpc?method=torrent-get&tag=299&fields='name','id'

Tried double quotes, no quotes, and all yield the same response from aibo99. Gimp's suggestion above should work too...any help anyone??
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: How to list all torrents by http request ?

Post by Jordan »

Try running

{{{
transmission-remote -l --debug
}}}

and look at the JSON message that remote sends to the daemon via an http POST... that should get you going.

Also there is in fact an example of listing torrents in the RPC spec. To get all torrents, rather than a subset, omit the "ids" argument in the request message.
minge
Posts: 3
Joined: Wed Mar 11, 2009 8:39 pm

Re: How to list all torrents by http request ?

Post by minge »

Can someone post an example that works:

localhost:9091/transmission/rpc?method=torrent-get&fields='name','id'

I can't get it to work. No mater what I try I get no fields specified errors


Thanks,
Aaron
Gimp
Web Interface Developer
Posts: 257
Joined: Mon Mar 12, 2007 3:49 am
Location: BC, Canada

Re: How to list all torrents by http request ?

Post by Gimp »

It seems like things like that aren't accessible from HTTP GET. only HTTP POST.
robotronic
Posts: 2
Joined: Fri Mar 20, 2009 3:06 am

Re: How to list all torrents by http request ?

Post by robotronic »

I can't get it to work using GET or POST, but they do give me different error messages.

These are the results of a http://localhost:9091/transmission/rpc with the following key/values: method:torrent-get, fields:name

POST:
{
"arguments": {},
"result": "no method name"
}

GET:
{
"arguments": { "torrents": [] },
"result": "no fields specified"
}
Post Reply