retracker.local

Started by Artem on 2011-08-22 16:13 — 42 replies, 15267 views

#1
Здравствуйте!
У меня такой вопрос как автоматически добавить к торрент-файлу дополнительный анонсер http://retracker.local/announce как на rutracker.org?
#2
поиском?
не адаптировам
// 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')
              );
#3
DarkMod, был такой модик из профиля выставляет вкл/откл retracker.local мне кажется это более удобное решение
#4
Varius, есть, каждый сам выбирает что ему сделать)
#5
поиском?
не адаптировам
// 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')
              );
в какую строку это вписать?
#6
functions_torrent.php
Найти:
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')
              );
#7
invalid torrent file пишет
#8
Помогите!!!🙂
#9
для адаптации надо в этом коде заменить
array(strval($ann_url . $passkey_url),),
на
array($announce),
#10
Используя этот так называемый мод, возможно подключить локальную сеть, т.е. один и более провайдеров. Что то на подобее ретрекера.?