Post
Topic
Board Services
Re: BitCoinTorrentz.com - Torrent Download Service
by
mjcmurfy
on 13/04/2012, 00:30:16 UTC
@2wieX: Thanks for the suggestion, but I'm not quite sure what you mean. Are you proposing using bytesized-hosting for scaling the site? They do not accept bitcoin as payment, so that's not really a feasible option since the site revenues are in bitcoin not usd. Or are you suggesting running bitcointorrentz in the same way as they do with their monthly subscription type plans? If that is what you mean, I don't really see the benefit of that compared with the bandwidth bundles that are already available. If you mean something else entirely, please elaborate.

And while I am here, just a quick update on magnet-link support.

Unfortunately, I have hit a snag while trying to integrate the functionality into the site. The problem is that the vast majority of magnet links do not include the filesize of the torrent in the uri scheme, so the cost of the torrent cannot be easily calculated. Magnet links only contain the torrent hash and the tracker address (and sometimes the name of the file). When you load the torrent into your client it connects to the swarm and downloads the metadata rather than it being provided in a .torrent file.

The only way I can think of obtaining the filesize would be to immediately load the torrent into the client after the link is provided, wait while the metadata is downloaded (can take up to 10 seconds) and then query the size using the client API. This would require some ajax magic and since the client pre-alocates hard drive space, it could potentially consume a lot of server resources. Since the user has not yet paid for the file, this would leave the site vulnerable to attack by malicious users loading lots of large torrents without ever paying.

I really don't want to set this up in a way that allows torrents to be loaded into the client before payment has been received.

Does anyone know a way to retrieve the filesize using just a magnet link and php?
Maybe it's possible to query the tracker using a curl command or something along those lines?