Source for file torrentinfo.php
Documentation is available at torrentinfo.php
* File_Bittorrent Example
* Get Info from a .torrent file
* # php torrentinfo.php -t file.torrent
* @author Markus Tacker <m@tacker.org>
* @version $Id: torrentinfo.php 10 2005-02-04 12:05:14Z m $
require_once 'File/Bittorrent/Decode.php';
require_once 'Console/Getargs.php';
// Get filename from command line
'desc' => 'Filename of the torrent'
$args = & Console_Getargs ::factory ($args_config);
if (PEAR ::isError ($args) or !($torrent = $args->getValue ('torrent'))) {
echo Console_Getargs ::getHelp ($args_config). "\n";
echo 'ERROR: "' . $torrent . "\" is not readable.\n";
$info = $File_Bittorrent_Decode->decodeFile ($torrent);
foreach ($info as $key => $val) {
echo str_pad($key . ': ', 20 , ' ', STR_PAD_LEFT );
foreach ($val as $file) {
echo str_repeat(' ', 20 ) . '- ' . $file['filename'] . "\n";
Documentation generated on Mon, 11 Mar 2019 14:23:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|