Adding torrent remotely using RPC

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
BoKKeR
Posts: 5
Joined: Mon Feb 06, 2017 6:55 pm

Adding torrent remotely using RPC

Postby BoKKeR » Mon Feb 06, 2017 7:02 pm

hey I am trying to add transmission to my torrent program. I need a way to add torrents remotely, in any form, magnet or file. the torrent-add method suggests that I need to have a torrent file on the server locally to be able to add it to transmission. I see no way to upload the file. no way to add only magnet link. am I missing something or its just not possible

killemov
Posts: 340
Joined: Sat Jul 31, 2010 5:04 pm

Re: Adding torrent remotely using RPC

Postby killemov » Wed Feb 08, 2017 8:15 am

It's not that simple, but yeah you are missing something.
https://github.com/killemov/Shift/blob/ ... t.js#L2848

x190
Posts: 5095
Joined: Sun Nov 30, 2008 4:59 am

Re: Adding torrent remotely using RPC

Postby x190 » Tue Feb 14, 2017 4:40 pm

The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

BoKKeR
Posts: 5
Joined: Mon Feb 06, 2017 6:55 pm

Re: Adding torrent remotely using RPC

Postby BoKKeR » Thu Feb 16, 2017 8:04 pm

x190 wrote:Older info, but might be useful?

https://blog.flo.cx/2011/02/how-to-open ... one-click/


thats more of a workaround. there should be a api call that could take magnet or torrent. Its not that big of a deal I dont get why its missing

killemov
Posts: 340
Joined: Sat Jul 31, 2010 5:04 pm

Re: Adding torrent remotely using RPC

Postby killemov » Thu Feb 16, 2017 9:16 pm

IT is not missing. You are missing something. The current rpc-spec allows for both torrents and magnets to be uploaded. Shift was the first web-client to use the FileReader api to read the torrent dropped onto the page and encode it and send it over the normal rpc connection. The Transmission team then copied this way of doing it. The OLD way was to post the data to a separate upload link.

BoKKeR
Posts: 5
Joined: Mon Feb 06, 2017 6:55 pm

Re: Adding torrent remotely using RPC

Postby BoKKeR » Sat Feb 18, 2017 12:21 pm

I managed to get the content of the .torrent added after I base64 encoded it with "torrent-add", "metainfo" but I cant get the the torrent added with a magnet link at all. I tried "filename" with utf8 and base64

x190
Posts: 5095
Joined: Sun Nov 30, 2008 4:59 am

Re: Adding torrent remotely using RPC

Postby x190 » Sun Feb 19, 2017 1:13 am

Either "filename" OR "metainfo" MUST be included.
378 All other arguments are optional.

"filename" | string filename or URL of the .torrent file

/transmission/rpc" -d "{\"method\":\"torrent-add\",\"arguments\":{\"paused\":${PAUSED},\"filename\":\"${LINK}\"}}"

Add magnet URI

magnet_link = "magnet:?xt=urn:btih:42ae58b8f59bd19fe97d6ca6fd884b2e9666a4d1&dn=debian-6.0.6-amd64-CD-2.iso&tr=http%3A%2F%2Fbttracker.debian.org%3A6969%2Fannounce"
torrent = Trans::Api::Torrent.add_magnet(magnet_link, paused: true)


I don't know what works or exactly what you're trying to do - just trying to help... . :)

The Web Interface accepts magnet links in the URL box, so I really think all you need is "torrent-add" + "filename" + "a regular magnet link".
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

BoKKeR
Posts: 5
Joined: Mon Feb 06, 2017 6:55 pm

Re: Adding torrent remotely using RPC

Postby BoKKeR » Sun Feb 19, 2017 9:23 am

yes that method worked with uTorrent but I had to escape the magnet link, here it dosent work I can try to utf8 encode it or base64 but it still wont work :/ I will look trough the code on the github tho thx

VoXqWBqQME6WtI
Posts: 10
Joined: Tue Jan 26, 2010 10:16 am

Re: Adding torrent remotely using RPC

Postby VoXqWBqQME6WtI » Sun Mar 19, 2017 11:50 am

viewtopic.php?p=67122#p67122

Check if my python magnet upload script will help somehow.

BoKKeR
Posts: 5
Joined: Mon Feb 06, 2017 6:55 pm

Re: Adding torrent remotely using RPC

Postby BoKKeR » Tue Mar 28, 2017 6:57 pm

Thanks it did solve my problem. thanks for the help :)


Return to “Web Interface”