// announce urls
$info = (@$tor['info']) ? $tor['info'] : array();
if (!@$info['name'] || !@$info['piece length'] || !@$info['pieces'] || strlen($info['pieces']) % 20 != 0)
{
torrent_error_exit('Invalid torrent file');
}
$totallen = 0;
if (@$info['length'])
{
$totallen = (float) $info['length'];
}
else if (@$info['files'] && is_array($info['files']))
{
foreach ($info['files'] as $fn => $f)
{
$totallen += (float) $f['length'];
}
}
else
{
torrent_error_exit('Invalid torrent file');
}
$totalsize = '';
$totalsize = sprintf('%.0f', (float) $totallen);
$topicname = '';
$topicname = urlencode(iconv('UTF-8', 'CP1251', $info['name']));
$tor['announce-list'] = array(
array(strval($ann_url . $passkey_url),),
array('http://retracker.local/announce')
);
// announce urls
$info = (@$tor['info']) ? $tor['info'] : array();
if (!@$info['name'] || !@$info['piece length'] || !@$info['pieces'] || strlen($info['pieces']) % 20 != 0)
{
torrent_error_exit('Invalid torrent file');
}
$totallen = 0;
if (@$info['length'])
{
$totallen = (float) $info['length'];
}
else if (@$info['files'] && is_array($info['files']))
{
foreach ($info['files'] as $fn => $f)
{
$totallen += (float) $f['length'];
}
}
else
{
torrent_error_exit('Invalid torrent file');
}
$totalsize = '';
$totalsize = sprintf('%.0f', (float) $totallen);
$topicname = '';
$topicname = urlencode(iconv('UTF-8', 'CP1251', $info['name']));
$tor['announce-list'] = array(
array(strval($ann_url . $passkey_url),),
array('http://retracker.local/announce')
);
if ($comment = trim($comment))
{
$tor['comment'] = strval($comment);
unset($tor['comment.utf-8']);
}
// announce urls
$info = (@$tor['info']) ? $tor['info'] : array();
if (!@$info['name'] || !@$info['piece length'] || !@$info['pieces'] || strlen($info['pieces']) % 20 != 0)
{
torrent_error_exit('Invalid torrent file');
}
$totallen = 0;
if (@$info['length'])
{
$totallen = (float) $info['length'];
}
else if (@$info['files'] && is_array($info['files']))
{
foreach ($info['files'] as $fn => $f)
{
$totallen += (float) $f['length'];
}
}
else
{
torrent_error_exit('Invalid torrent file');
}
$totalsize = '';
$totalsize = sprintf('%.0f', (float) $totallen);
$topicname = '';
$topicname = urlencode(iconv('UTF-8', 'CP1251', $info['name']));
$tor['announce-list'] = array(
array(strval($ann_url . $passkey_url),),
array('http://retracker.local/announce')
);