Magnet Links: The New BitTorrent Approach


by Paul Arnote (parnote)

It’s late at night. You’re wanting to fill up your MP3 player with songs for your vacation. You have all of your favorite music on CDs that you have purchased, but don’t want to take the time to rip those CDs to MP3 files. Instead, you opt to download that very same music that you purchased on CDs as MP3 files, via torrent files.

Does that scenario sound familiar? Of course, torrent files aren’t just for downloading music or video files. Torrent downloads can also include entire operating systems, such as PCLinuxOS. In fact, that’s one of the distribution methods utilized by PCLinuxOS to get the operating system into the hands of users.

Unfortunately, there has been an international crack down on torrent tracker sites by the “copyright gestapo,” more commonly known as the MPAA and RIAA, in cahoots with their paid-off politicians. It has resulted in more than one torrent site closing down, out of fear of being caught up in the witch hunt for those committing copyright infringement. Still, there are torrent sites who refuse to be bullied about, and who refuse to shut down. Instead, they’ve switched to using what has become known as “magnet links.”

The “traditional” torrent file method

Traditionally, you download a .torrent file (also known as a torrent tracker) to your computer from a torrent site. This is a smaller file, containing information about the larger file you want to download. This information includes a list of the files being shared, the URL for those files, and other pertinent information. Your torrent client (Deluge, Transmission, Ktorrent, etc.) calculates a hash code for that particular torrent. The torrent server then uses that hash code to find others who are uploading those files, so you can download from them.

Five of the torrent clients in the PCLinuxOS repository.

There are quite a few torrent clients in the PCLinuxOS repository. Here is a list of most of them. I’m only listing those that are more commonly used for downloading torrents.

  1. BitTorrent (unknown)
  2. Deluge (Gtk+/Gnome)
  3. FatRat (Qt4)
  4. Gnome BTDownload (Gtk+/Gnome)
  5. Ktorrent (KDE/Qt4)
  6. qBittorrent (Qt4)
  7. rTorrent (command line)
  8. Transmission (Gtk+)
  9. Vuze (Java)

With the traditional approach, using torrent trackers downloaded from a central torrent server, users are much more likely to receive a DMCA (Digital Millennium Copyright Act) take down notice, according to a 2008 University of Washington Department of Computer Science & Engineering study. The copyright gestapo are more likely to link your IP address with the torrent tracker file that was downloaded, resulting in a cease-and-desist order coming from your ISP or the MPAA or RIAA themselves – regardless of whether you completed the torrent download or not.

What are “magnet links?”

Magnet links skip the “middle man,” with the hash values being calculated on the server end (instead of by the torrent client) and are sent to the torrent client. The torrent client then uses the hash value to seek out the addresses of peers on the network, connects to them, downloads the .torrent file, then the desired content. In this way, no torrent tracker files are stored at any central repository, such as PirateBay or bitsnoop, making it much, much more difficult for your torrent activity to be tracked – and decreasing the likelihood that you’ll be receiving one of those aforementioned cease-and-desist orders.

Here is what a couple of magnet links look like:

magnet:?xt=urn:btih:768435fee54cf3c072c36f5ede02289509e49386&dn=Dream+House+2011+720p+BDRip+x264+ac3+subs+%28mkv%29+%5BGREYSHADOW%5D&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80

magnet:?xt=urn:btih:X77SNTKZAWN3EQZSNKB7KRS7TNTZ3YSH&tr=http://tracker.mininova.org/announce

The original specification came out for magnet links in January 2008, and called for base32 encoding. Then, in May 2008, the specification was changed in favor of hexadecimal encoding. The first magnet link listed above, from PirateBay, uses hexadecimal encoding. Other sites, like mininova, use the original base32 encoding, as shown in the second magnet link. Your torrent client should not balk at either, and will accept both without hesitation. This includes all of the torrent clients currently in the PCLinuxOS repository.

A partial screen capture from PirateBay.

Does this mean that torrent tracker files have gone away? Not at all, and probably not any time soon. But, the move is more and more towards the use of the magnet links. In the above screen capture, there are two download links (in green). The first one, labeled “Get This Torrent” with the magnet next to it, is (you guessed it!) the magnet link. The second one, labeled “Get Torrent File” and with the double green arrows next to it, is the traditional torrent tracker file.

Adding support to your web browser

Neither Firefox nor Chromium Browser know how to handle magnet links. So, we have to teach them what to do with them. The method below depends on gconftool-2 being installed. As far as I can tell, it comes as part of the base installation of PCLinuxOS, without regard to the desktop environment being used.

Enter the following three lines in a terminal session:

gconftool-2 -t string -s /desktop/gnome/url-handlers/magnet/command "transmission %s"

gconftool-2 -s /desktop/gnome/url-handlers/magnet/needs_terminal false -t bool

gconftool-2 -t bool -s /desktop/gnome/url-handlers/magnet/enabled true

In the first line, substitute transmission (inside the quotes at the end) with the name of the torrent client you are using. These commands register magnet links with xdg-open to open them with your chosen torrent client.

Now, when you click on a magnet link in Chromium Browser, the magnet link will open in your chosen torrent client. When you click on a magnet link in Firefox, you will be given the choice to choose the application to use. Select your torrent client (the one you used in the above commands should be listed). Be sure to mark the check box at the bottom of the dialog box for Firefox to “remember” what to do with magnet links in the future before you click on the OK button.

To be honest, I was surprised that magnet links worked without further modification in Firefox. Everything I found on the Internet pointed to having to go into about:config and changing some settings there. In fact, I was prepared to write a whole separate section on how to get Firefox to recognize magnet links when I decided to first give them a try, having made the entries above for Chromium Browser. But as it turns out, Firefox also picks up on what to do with magnet links, using the method above.

Summary

Try as hard as they may, the MPAA, RIAA and the misinformed, misdirected politicians will not succeed in making file sharing disappear. Instead, they will force it deeper and deeper underground. Developers will devise ways to hide and otherwise obscure file sharing activities.

I must say that I’m not condoning copyright infringement. However, when I purchased the same music on vinyl records, then audio CDs, the copyright holder got double their pound of flesh from me. Just because the primary and preferred format for music distribution changes, it shouldn’t mean that the copyright holder should be able to extract yet another pound of flesh – all over nothing more than a distribution format change. I paid the price – twice in many cases – for the rights to listen to that copyrighted content. In my honest opinion, the same holds true for other media (videos) whose primary distribution format changes, but the content remains the same.