MagnetMakingGuide

From Gnufu

This is a guide, which shows you how to create working magnet-links for your website, which serve files you hosts on your server.

Also you can use this guide to create magnets which tell your Gnutella program to download a file from many mirror-servers at the same time.


Table of contents

1: Make a normal Magnet

To create a working magnet for your Website you first need to create a standard magnet-link. You can do that either with with Phex ( http://phex.org ), LimeWire ( http://www.limewire.com ) or with Bitcollider ( http://bitzi/bitcollider ).

1.1: With Phex

Set up sharing, so that the file is in your shared files. Then go to the Library and select export (bottom of the window). Select "Phex default (HTML)", then select "include my IP" and click export.

Open the exported file in your browser and find and copy the link to your file. This is the magnet in the form:

magnet:?xt=urn:sha1:<sha1-hash-code>&dn=<filename>&xs=<ip>:<port>/uri-res/N2R?<hash-code>

Continue in Step 2.

1.2: With LimeWire

Set up sharing, so that the file is in your shared files. Then go to the file-library and select the file. Right click it (ctrl-click for Mac Users) and choose "Show Magnet-Details".

A Webpage opens up, where you see a magnet. This magnet is in the form:

magnet:?xt=urn:sha1:<hash-code>&dn=<filename>&xs=<ip>:<port>/uri-res/N2R?<sha1-hash-code>

Continue in Step 2.

1.3: With BitCollider

Add the file-information with BitCollider to the bitzi-database ( http://bitzi.com ). Then right-click the small magnet-icon and copy the URL (ctrl-click for Mac-Users).

Paste the Link into a Text-Editor.

Now you have a magnet. This magnet is in the form:

magnet:?xt=urn:sha1:<hash-code>&dn=<filename>

Continue in Step 2.

2: Add the URL of the file

Copy the http-Link of the file on the Internet. I'll call that adress "<location>". Add the following to the magnet-link (without the quotes): "&as=<location>"

Now you have a Magnet-Link, which tells magnet-supporting file-sharing programs to find the file in the network and to use the internet-address if it can't find the file in the filesharing network.

Put it on your Webpage like you would any normal link. The filesharing programs open automatically, when you click on it (if one is installed on the visitors machine).

You can put in as many alternate URLs as you wish this way.

2.1: Optional: Add your dyndns-host

To serve as first host yourself, you can also replace your IP with a dyndns-host address. You can get more information on their site (http://www.dyndns.com/services/dns/dyndns/).

When you have your dyndns-address, just replace the ip-part of the magnet with the dyndns-address. Then the magnet should look like this:

without http-url:
magnet:?xt=urn:sha1:<hash-code>&dn=<filename>&xs=<dyndns-host>:<port>/uri-res/N2R?<hash-code>

with http-url:
magnet:?xt=urn:sha1:<hash-code>&dn=<filename>&xs=<dyndns-host>:<port>/uri-res/N2R?<hash-code>&as=<http-url>

2.2: Optional: Add the freebase sourcecache

Additionally you can add the sourcecache from freebase.be.

Upon connection it returns the IPs of the last 10 people who connected to it: http://freebase.be

To include it in a magnet, just add an xs-source as shown in the following example:
&as=http://www.freebase.be/g2/dlcount.php?sha1=<sha1-hash-code>

A magnet with freebase then looks like the following:
magnet:?xt=urn:sha1:<hash-code>&dn=<filename>&as=http://www.freebase.be/g2/dlcount.php?sha1=<sha1-hash-code>

2.3: Magnet with all optional infos

including all optional ways, you then get a magnet like the following:
magnet:?xt=urn:sha1:<hash-code>&dn=<filename>&xs=<dyndns-host>:<port>/uri-res/N2R?<sha1-hash-code>&as=<location>&as=<http-url>&as=http://www.freebase.be/g2/dlcount.php?sha1=<sha1-hash-code>

A real life example is the magnet used to download the new Version of Phex:

magnet:?xt=urn:sha1:Z6NI2PW4BFSAVV2XYWVYWWFQNDO3JP3D&dn=phex_3.2.0.102.zip&xs=http://edrikor.dyndns.org:9846/uri-res/N2R?urn:sha1:Z6NI2PW4BFSAVV2XYWVYWWFQNDO3JP3D&as=http://www.freebase.be/g2/dlcount.php?sha1=Z6NI2PW4BFSAVV2XYWVYWWFQNDO3JP3D&as=http://heanet.dl.sourceforge.net/sourceforge/phex/phex_3.2.0.102.zip

To avoid using extremely long links, you can also use Magma-lists, which can also serve many magnets in one file, but they are only useable with Phex at the moment.

Sidenote: The sha1-code must be base32 encoded, uppercase.

Links