I know that using code <a href="mailto:john.smith@gmail.com">John Smith</a>
I can call email clients to send emails to who I want.
Now, how can I call torrent client softwares to download a torrent?
I know that using code <a href="mailto:john.smith@gmail.com">John Smith</a>
I can call email clients to send emails to who I want.
Now, how can I call torrent client softwares to download a torrent?
Technically, you are not calling an email client when a user clicks on such a link. Instead, the client launches the application registered for handling that type of URI. The technical name for the mailto
part of the URI is the scheme.
What you actually want is the Magnet URI Scheme.
To generate a BitTorrent magnet URI, you need to extract the info
section of the bencoded .torrent file contents, as described in the BitTorrent protocol specification. Generate the SHA-1 hash of the data (this is called the "infohash"), then hex-encode that hash. You can also include a tr
parameter to declare where the tracker is. e.g.
magnet:?xt=urn:btih:<your_hex_encoded_sha1_hash>&tr=http://urlto/announce
For further reading, I would suggest How do BitTorrent magnet links work?.
you could use a magnet link
(this is a example for a file with 0bytes)
magnet:?xt=urn:ed2k:31D6CFE0D16AE931B73C59D7E0C089C0
&xl=0&dn=zero_len.fil
&xt=urn:bitprint:3I42H3S6NNFQ2MSVX7XZKYAYSCX5QBYJ
.LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ
&xt=urn:md5:D41D8CD98F00B204E9800998ECF8427E
then you can personalize your magnetic link to managing the downloading for the file that you want to be downloaded.
source http://en.wikipedia.org/wiki/Magnet_URI_scheme#Technical_description