cfx_bittorrentfile v0.2 - .torrent file parsing for ColdFusion server

Installation:

Install like any other CFX tag.

Usage:

<cftry>
<cfx_bittorrentfile filename="/path/to/file.torrent" variable="Info">
<cfcatch>
<cfset DoDelete=True>
<cfset BTError=ListChangeDelims(CFCatch.Detail,"<br>",Chr(13))>
</cfcatch>

The "variable" parameter is optional, and defaults to "TorrentFile".

This sets a structure "Info" with the following sub-keys from the .torrent file:

Info.Name         = /info/name
Info.Announce     = /announce
Info.Length       = /info/length  OR  SUM(/info/files/*/length)
Info.SHAHash      = hex(SHA1(/info/*))
Info.PieceLength  = /info/piece length
Info.FileCount    = 1  OR  LENGTH(/info/files/*)

The following fields may be blank, as they are optional:

Info.CreationDate = /creation date
Info.CreatedBy    = /created by
Info.Comment      = /comment

There is also a query created (variable + "Files" : "InfoFiles"):

InfoFiles = QueryNew("Name,Length,Path,MD5Sum")

Please note that the MD5Sum may be blank, as it is optional.

Tested With:

CF Server 4.5.1 SP2
CF MX Server 6.1.0.60662

More Information:

http://sourceforge.net/projects/torrentspy/

Written By:

Rick Osborne < knowbuddy (aht) rixsoft (dt) com >