Proposed by: Wim Leers

UPDATE:

Originally I intended this as my own project proposal, but - unexpectedly - I was given the opportunity for working on a new startup, which is of course even better than SoC. If somebody would like to continue with this proposal, and I'm sure somebody will because I've already been contacted three times about this proposal, the SoC mentors may decide whom is the best candidate.
Users who contacted me: hugomelo (on March 25), bradfordcp (on March 19), CitizenKane (on March 1).
Also I've been contacted by the original BitTorrent Tracker module for Drupal 4.6, which wasn't released to the public, out of fear for abuse back then. Now there are plenty perfectly legal use cases, so that fear is now obsolete, and that's why he contacted me. This means you will have something to start from, or at least something you can learn from.

Motivation

The need for a good BitTorrent tracker for Drupal is obvious. More and more sites provide large downloads, and BitTorrent is the best way to distribute those files. Also many communities are built around a BitTorrent tracker, why not let them benefit from Drupal's possibilities?

Deliverables

The module should store its torrents as a CCK field -- it's advised to start with the existing filefield module and build on it. Of course, there should be a torrent tracker which conforms to the BitTorrent 1.0 protocol as written here. It's important for the tracker to honor the access rights of the corresponding node.

Architectural Problems

The tracker listing of all currently available torrents (the visual part of a tracker) is the part most of us only know. This is just a webpage, and since Drupal is a CMS, that's not a problem.
The "invisible tracker" (the announce URL) the BitTorrent clients access however, may have to deal with a significant amount of requests. Then there also is the scrape convention, which may also have to process quite some traffic. The point is: the BitTorrent client part should be as little CPU, memory and database intensive as possible. Therefore we will have to make these two stand-alone files (announce.php and scrape.php), similar to xmlrpc.php, to avoid a full bootstrap.

Remarks

Code will be inspired by existing BitTorrent trackers in PHP, such as phpMyBitTorrent and T-Xore (which has no real homepage, but it's the software on which mininova.org runs). The delivered code however will be code conform the Drupal standards and will be optimized for the described approach.

Future Additions

  • "Torrentizer" that turns every file that passes configurable criteria into a .torrent file and then let the tracker pick it up.
  • "Server seeding" of files that were torrentized. This requires a Drupal BitTorrent client, thus written in PHP. This faces quite difficult problems, such as the requirement of using sockets. This may become easier to accomplish if the WebSeeding extension of the BitTorrent protocol gets standardized and implemented in most clients.
  • As soon as this is supported by FileAPI: Amazon S3 support for seeding bandwidth (S3 supports BitTorrent access for every publicly available file).

Comments on this proposal

Torrent Encoding
goodnessme - June 16, 2007 - 23:41

I would much like this module. In my experience trying to develop somethins similar to this, I have found some good bittorrent scripts at glutorrent in particular, PHPBencode which seems to make dealing with torrent files easy.

Good luck with your development!
======================================================
======================================================

SoC Project
bradfordcp - June 28, 2007 - 17:57

I am actively developing this module, you can find it at http://drupal.org/project/bittorrent

The torrent node type is currently stable and the tracker will be coming online shortly. Feel free to send me a message if you have any questions.
~Chris
======================================================
======================================================

ibiblio.org's Osprey project
casconed - June 25, 2007 - 18:53

http://osprey.ibiblio.org/ comes to mind immediately. Could a drupal module be rolled from this?
======================================================
======================================================

Permaseed!
crocodyl - December 10, 2007 - 14:30

ibiblio has created a technology called Osprey that would be so awesome for integrating bittorrent into Drupal.

It has solved the "no one will seed this" problem, by hosting the original file on the servers with a single seed. The "startup cost" for the bandwidth to download the file is always "one" but the second, third and millionth download displace bandwidth to the network. Only if everyone stops seeding does the burden get placed back on the server again. The primary goal of having the file always available is maintained.

They are really cool people and the software is totally Libre. This would be so awesome--ok I already said that, I will shut up now.
======================================================
======================================================