Opened 11 years ago

Closed 11 years ago

#4081 closed Enhancement (fixed)

Request: Add "cookieString" argument "torrent-add" method in RPC

Reported by: bulljit Owned by: jordan
Priority: Normal Milestone: 2.30
Component: Daemon Version: 2.20
Severity: Normal Keywords:
Cc:

Description

Firstly, thank you for the cookies.txt feature, it works wonderfully!

Adding the "cookieString" option will allow adding PRIVATE torrents in a much simpler way for the end user.

curl_easy_setopt( e, ''CURLOPT_COOKIE'', cookie_string );

In my current setup, I have a bookmarklet which passes the torrent's link.href and document.cookie to a php script that then uses curl to download the torrent into my watch folder. If the "cookieString" option was available, the same thing could be achieved without running a separate web server.

Attachments (1)

cookies-01.diff (9.8 KB) - added by jordan 11 years ago.
first draft

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by straddle

+1 Vote for this!

This would enable the remote download bookmarklet to support private trackers:

https://github.com/bulljit/Transmission-Add-Torrent-Bookmarkelet

Last edited 11 years ago by straddle (previous) (diff)

comment:2 Changed 11 years ago by jordan

  • Milestone changed from None Set to Sometime

Changed 11 years ago by jordan

first draft

comment:3 Changed 11 years ago by jordan

bulljit, attached is a bare-bones patch against r12164 which adds cookie support to RPC.

If I'm understanding the request correctly, I think the use case for this feature is a good one, but it's limited to other web clients that already have cookies for the user's tracker sessions. So I've resisted the urge to add more code for this in other places like transmission-remote, at least for now... if you think more is needed, I'm happy to listen to ideas.

Now, I need to find a JavaScript? hacker to try this out in Transmission's web client... :)

Version 1, edited 11 years ago by jordan (previous) (next) (diff)

comment:4 Changed 11 years ago by bulljit

Wonderful, I will test it out soon...

I already have the javascript code setup for my iphone bookmarklet, just need to get to my Mac at home. Now I'm dreading the rest of the workday untill I get home and play with this. Thanks alot!

comment:5 Changed 11 years ago by bulljit

Well done! I can confirm that the patch works with both transmission-daemon and Transmission.app using Javascripts XMLHttpRequest.

As for adding the function to transmission-remote, I do think it is something that should be done eventually (but very low priority):

  • most users use transmission-remote to automate things through scripts, so it is certainly conceivable to obtain the most up to date cookie through your browsers database (ie cookies.plist in Safari) and pass it along when adding a new torrent
  • i use t-remote mainly to figure out the appropriate json arguments to pass along for my javascripts
  • if you're OCD at all, it should be added just for completeness-sake :)

Thanks again, and please consider committing it to the trunk soon.

comment:6 Changed 11 years ago by jordan

It's not so much an issue of OCD, as it is that it's easier to add features than it is to maintain them. I used to add features to Transmission all the time, but after you do that for a couple of years you wind up with a whole lot of code and a whole lot of features, and wonder if feature X, Y, and Z are actually used by anyone anymore and whether or not they're worth maintaining.

To make a long story short, it's better to wait until there's someone knocking on the door with a non-hypothetical use case for cookies in transmission-remote :)

Last edited 11 years ago by jordan (previous) (diff)

comment:7 Changed 11 years ago by jordan

  • Component changed from Web Client to Daemon
  • Milestone changed from Sometime to 2.30
  • Owner set to jordan
  • Status changed from new to assigned

comment:8 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.