retracker.local

Artem

Пользователь
Здравствуйте!
У меня такой вопрос как автоматически добавить к торрент-файлу дополнительный анонсер

Please Login or Register to view hidden text.

как на rutracker.org?
 

DarkMod

Пользователь
поиском?
не адаптировам
PHP:
// 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')
              );
 

Varius

Пользователь
DarkMod, был такой модик из профиля выставляет вкл/откл retracker.local мне кажется это более удобное решение
 

Artem

Пользователь
поиском?
не адаптировам
PHP:
// 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')
              );
в какую строку это вписать?
 

Lange

Пользователь
functions_torrent.php
Найти:
PHP:
if ($comment = trim($comment))
  {
    $tor['comment'] = strval($comment);
    unset($tor['comment.utf-8']);
  }
После добавить:
PHP:
  // 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')
              );
 

max

Пользователь
для адаптации надо в этом коде заменить
Код:
array(strval($ann_url . $passkey_url),),
на
Код:
array($announce),
 
S

Saint

Гость
Используя этот так называемый мод, возможно подключить локальную сеть, т.е. один и более провайдеров. Что то на подобее ретрекера.?
 
Сверху