Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#2096 closed Enhancement (fixed)

Magnet links - Extension for Peers to Send Metadata Files (BEP #9)

Reported by: jch Owned by: charles
Priority: High Milestone: 1.80
Component: Transmission Version: 1.61
Severity: Normal Keywords: bep
Cc: jch@…, colrol@…, scoopy@…, udovdh@…, joeterranova@…, yannbreliere@…, lists@…, ovitters, David@…, tiennou7@…, koma@…, User294

Description

Now that we're likely to have DHT support in a future release, it makes a lot of sense to think about implementing BEP 9.

http://bittorrent.org/beps/bep_0009.html

With BEPs 5 and 9 implemented, it becomes possible to join a torrent without the .torrent file, just the torrent's info-hash. This is done by first locating a number of peers using the DHT, and then downloading the info dictionary using BEP 9.

The expected user interface is to parse « magnet:btih: » links.

Attachments (3)

magnet-handler.diff (8.3 KB) - added by tiennou 7 years ago.
Handle magnet links in OSX Transmission
0001-Avoid-crash-on-magnet-links-with-no-display-name.patch (827 bytes) - added by jch 7 years ago.
0001-More-crashes-with-magnet-proto-torrents.patch (1.2 KB) - added by jch 7 years ago.

Download all attachments as: .zip

Change History (51)

comment:1 Changed 7 years ago by jch

  • Cc jch@… added

comment:2 Changed 7 years ago by livings124

  • Priority changed from Lowest to Normal
  • Severity changed from Minor to Normal

comment:3 Changed 7 years ago by charles

  • Owner set to charles
  • Status changed from new to assigned

comment:4 Changed 7 years ago by Rolcol

  • Cc colrol@… added

comment:5 Changed 7 years ago by charles

  • Summary changed from Extension for Peers to Send Metadata Files to Extension for Peers to Send Metadata Files (BEP #9)

comment:6 Changed 7 years ago by charles

  • Keywords bep added

comment:7 Changed 7 years ago by livings124

  • Summary changed from Extension for Peers to Send Metadata Files (BEP #9) to Magnet links - Extension for Peers to Send Metadata Files (BEP #9)

comment:8 Changed 7 years ago by ville

  • Cc scoopy@… added

comment:9 Changed 7 years ago by udo

  • Cc udovdh@… added
  • Keywords tpb added

comment:10 Changed 7 years ago by livings124

  • Keywords tpb removed

comment:11 Changed 7 years ago by charles

  • Milestone changed from None Set to 1.80
  • Priority changed from Normal to High

comment:12 Changed 7 years ago by jch

milestone changed from None Set to 1.80

Eh?

You mean you're planning to hold off 1.80 until that is done? Do you have a cunning plan? Bacause to me it looks like it's not quite trivial.

--Juliusz

comment:13 Changed 7 years ago by joecot

  • Cc joeterranova@… added

comment:14 Changed 7 years ago by yanndinendal

  • Cc yannbreliere@… added

comment:15 Changed 7 years ago by thijs

  • Cc lists@… added
  • Severity changed from Normal to Major

With the piratebay tracker being down from now on, this ticket should probably get the highest priority imo.

comment:16 Changed 7 years ago by livings124

  • Severity changed from Major to Normal

Unless you volunteer to work on a fix, you have no right to set the priority.

comment:17 follow-up: Changed 7 years ago by thijs

Then don't give me the permissions to do so, you can configure that in Trac. Anyway, sorry for changing the permission, and hopefully we'll find a volunteer soon then.

comment:18 in reply to: ↑ 17 ; follow-up: Changed 7 years ago by charles

Replying to thijs:

Then don't give me the permissions to do so, you can configure that in Trac.

Done. You no longer have permissions to do anything in Trac. Most users don't need to be told that giving marching orders is rude, but to each their own.

Also: I've already milestoned the ticket for our next release. What were your goals here -- for us to go back in time and include it in 1.76?

comment:19 Changed 7 years ago by thijs

Seriously? I just suggested that you make sure your users can't make unwanted changes by not giving them the permissions to do so, it was a heads up, and I wasn't trying to be rude. Goodbye and good luck.

comment:20 Changed 7 years ago by charles

Yes, seriously. Bye!

comment:21 Changed 7 years ago by jch

Before you comment on this bug, please make sure that you have read and understood the following posting:

http://forum.transmissionbt.com/viewtopic.php?f=3&t=2439#p42092

comment:22 follow-up: Changed 7 years ago by livings124

Yup, there is a ticket for trackerless torrents #2110. That HAS to be implemented before this is feasible.

comment:23 in reply to: ↑ 22 Changed 7 years ago by jch

Replying to livings124:

Yup, there is a ticket for trackerless torrents #2110.

Which, unlike this ticket, is easy.

--Juliusz

comment:24 Changed 7 years ago by Rolcol

Wow, so many changes to this ticket in only 24 hours. Does information gathered through magnet links list the file names? It'd be nice to be able to rename torrents whether they were added through magnet links or .torrent files.

Good luck. I'll help test this when it's implemented.

comment:25 in reply to: ↑ 18 ; follow-up: Changed 7 years ago by Rolcol

Replying to charles:

Replying to thijs:

Then don't give me the permissions to do so, you can configure that in Trac.

Done. You no longer have permissions to do anything in Trac. Most users don't need to be told that giving marching orders is rude, but to each their own.

Also: I've already milestoned the ticket for our next release. What were your goals here -- for us to go back in time and include it in 1.76?

Does this apply to everyone then? I can't make changes even if I wanted to.

comment:26 Changed 7 years ago by charles

r9531 adds a magnet link parser and unit tests to make sure it works properly as per BEP #9 wrt hex-encoded and base32-encoded info hashes.

Since so many people seem to be watching this ticket... this is not magnet support yet. It's part of the prerequisite infrastructure.

comment:27 Changed 7 years ago by ovitters

  • Cc ovitters added

comment:28 Changed 7 years ago by David Munch

  • Cc David@… added

comment:29 Changed 7 years ago by charles

An early test implementation of this is now available in trunk r9550.

Should work now for the GTK+ client, and the web client's "add URL".

Probably the Mac and Qt interfaces will need a little work before you can start testing adding magnet links with them.

comment:30 Changed 7 years ago by tiennou

  • Cc tiennou7@… added

This patch adds what's needed to make Transmission see that a magnet link was clicked. Tested it on tpb's magnets, and it works, though it just NSLogs the url.

livings, if you're willing to give me some advice on where should I tweak Torrent.m, I'll be glad to do it. I've just been baffled at its designated initializer...

comment:31 Changed 7 years ago by tiennou

Updated patch. I tweaked Torrent designated initalizer a little, added -initWithMagnetURL:lib:. I now get magnet torrent added, but you better stay away from them, since most of the code will crash until you actually get the real torrent file.

Changed 7 years ago by tiennou

Handle magnet links in OSX Transmission

comment:32 Changed 7 years ago by tiennou

Fix more crashes by setting the download location. I got one down in tr_bitsetOr, not sure it's related. You'll get an NSString cstring is nil exception when selecting it, then you can start (nil cString exception again), and after a while it will download normally.

comment:33 Changed 7 years ago by jch

Makes it crash slightly later.

comment:34 Changed 7 years ago by charles

updates in r9553, r9554

comment:35 Changed 7 years ago by jch

More crash avoidance. Now crashes at the first handshake.

--Juliusz

comment:36 Changed 7 years ago by jch

The handshake crash is due to getExistingHandshake, called (indirectly) from reconnectTorrent, being called on a handshake that was freed by handshakeAbort.

Since I don't grok this code, I'm giving up trying to fix it.

--Juliusz

comment:37 Changed 7 years ago by koma

  • Cc koma@… added

comment:38 Changed 7 years ago by charles

charles * r9591 libtransmission/ (torrent.c torrent.h transmission.h): (trunk libT) #2096 "magnet links" -- add a callback for clients to know when a magnet torrent's metainfo is finished downloading.

comment:39 Changed 7 years ago by User294

  • Cc User294 added

comment:40 Changed 7 years ago by charles

r9635 (trunk gtk) #2096 "magnet links" -- if a user (or, more likely, web browser) starts up a second copy of Transmission to add a magnet link via its command line, delegate that magnet link back to the already-running copy of Transmission via DBus.

comment:41 Changed 7 years ago by charles

r9656 cli/cli.c: (trunk cli(!)) #2096 "Magnet links - Extension for Peers to Send Metadata Files (BEP #9)" -- add support for adding magnet links as a command-line argument

comment:42 Changed 7 years ago by KyleK

r9655 introduced a new RPC command to determine the percentage of a metadata download, unfortunately it contains a typo:

metadataPecentComplete

is most likely meant to be:

metadataPercentComplete

comment:43 Changed 7 years ago by charles

r9660 (trunk) #2096 "magnet links" -- fix RPC typo introduced in r9655 and reported by KyleK

comment:44 Changed 7 years ago by charles

r9662 (trunk) #2096 "magnet links" -- add "Copy Magnet Link to Clipboard" feature to Qt client

comment:45 Changed 7 years ago by charles

r9663 (trunk, qt) #2096 "magnet links" -- fix crash in Qt client when displaying magnet links

comment:46 Changed 7 years ago by charles

20:31 < CIA-22> kjg * r9665 web/ (3 files in 3 dirs): (trunk web) show relevant status and progress bar for when a magnetized torrent is still waiting for metadata

21:05 < CIA-22> charles * r9666 qt/torrent-delegate.cc: (trunk, qt) #2096: show magnet links the same way the gtk+ client does

comment:47 Changed 7 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:48 in reply to: ↑ 25 Changed 6 years ago by mike3050

Replying to Rolcol:

Replying to charles:

Replying to thijs:

Then don't give me the permissions to do so, you can configure that in Trac.

Done. You no longer have permissions to do anything in insurance quotes Trac. Most users don't need to be told that giving marching orders is rude, but to each their own.

Also: I've already milestoned the ticket for our next release. What were your goals here -- for us to go back in time and include it in 1.76?

Does this apply to everyone then? I can't make changes even if I wanted to.

I try it too,but i can't.

Note: See TracTickets for help on using tickets.