transmission icon indicating copy to clipboard operation
transmission copied to clipboard

Support xs= or as= for Magnet downloads

Open muelli opened this issue 8 years ago • 2 comments

From looking at https://github.com/transmission/transmission/blob/deea6fc6a206701e7f724522b61739140d78bbff/libtransmission/magnet.c#L160 it seems that , currently, neither xs nor as keys seem to be parsed out of magnet URIs. I think it'd be nice to make transmission fall back to a HTTP download of a torrent when locating it via the DHT fails.

Also see https://github.com/webtorrent/webtorrent/issues/875

muelli avatar Jun 29 '17 13:06 muelli

There doesn't seem to be a BEP for these but it is discussed at https://wiki.theory.org/BitTorrent_Magnet-URI_Webseeding:

Retrieving metadata - "xs=" parameter

  • If the "xs=" parameter is present then a client SHOULD try to retrieve a .torrent file via the URL provided by the "xs=" parameter.
  • If a client does not understand the protocol in this URL then it MUST silently ignore this specific "xs=" parameter with this URL.
  • If the retrieved file is not a valid .torrent file then the .torrent file MUST be silently discarded.
  • If the Bittorrent Info Hash provided by the magnet URI ("xt=urn:btih:") does not match the "info" section of the retrieved .torrent file then the .torrent file MUST be silently discarded.
  • If a client is capable of BEP9 then it SHOULD use both mechanisms in parallel.

Retrieving metadata - "as=" parameter

  • If no metadata could be retrieved with the mechanism specified in BEP9 or with any provided "xs=" parameter and if an "as=" parameter is present then a client SHOULD try to retrieve a .torrent file via the URL provided by the "as=" parameter.
  • If a client does not understand the protocol in this URL then it MUST silently ignore this specific "as=" parameter with this URL.
  • If the retrieved file is not a valid .torrent file then the .torrent file MUST be silently discarded.
  • If the Bittorrent Info Hash provided by the magnet URI ("xt=urn:btih:") does not match the "info" section of the retrieved .torrent file then the .torrent file MUST be silently discarded.

ckerr avatar Jan 17 '23 20:01 ckerr

I've been supporting this in anacrolix/torrent for a while if it helps:

https://github.com/anacrolix/torrent/blob/d2d8125eea118567dab268457eda8f774abf98b9/spec.go#L27 https://github.com/anacrolix/torrent/blob/3e0f34934df4f109b39b5e28e674b438732a7ab8/sources.go#L63-L79

anacrolix avatar Jan 23 '23 03:01 anacrolix