Универсальный парсер

Универсальный парсер 0.7.2

Нет прав для скачивания

Nikita11

Пользователь
ребят рутор есть у кого работает? переделал на zerkalo-rutor. но торрент скачиваеться криво:
preg_match ("#<a href=\"http:\/\/zerkalo-rutor\.org\/download\/\d+)\"#si", $copy_page, $r_torrent);
 

Ragnar

Пользователь
ребят рутор есть у кого работает? переделал на zerkalo-rutor. но торрент скачиваеться криво:
preg_match ("#<a href=\"http:\/\/zerkalo-rutor\.org\/download\/\d+)\"#si", $copy_page, $r_torrent);
Все парсится и без зеркала по прямой ссылке. Проверяйте права.
 

votanumu

Пользователь
votanumu торрент-файл проблемный приложите тут в архиве, который движок зарегистрировать не может.
В понедельник все заработало. Хотя ничего не менял. Может глюк какой был на сервере, хотя несколько раз перезагружал. Главное что сейчас все работает.
 

Ress Kent

Пользователь
на некоторый раздачах рутора после парсинга в тексте появляются теги <li> для их фильтрации
найти
PHP:
$text = preg_replace("#<hr />#si", "[hr]", $copy_release);
вставить ниже
PHP:
$text = preg_replace("#<li>#si", " ", $copy_release);
 

whuru

Пользователь
Не парсит с рутора и с нонейма. С рутрекера всё нормально. При попытке парсинга с рутора вываливает нотисы:

Код:
Notice: Undefined offset: 1 in /var/www/library/includes/functions_parser.php on line 71

Notice: Undefined offset: 1 in /var/www/library/includes/functions_parser.php on line 125

PHP:
function parse_rutor($url, $gettorrent)
{
   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_USERAGENT, 'IE20');
   curl_setopt($ch, CURLOPT_HEADER, 0);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, '1');
   $copy_page = curl_exec($ch);
   curl_close($ch);
   
   preg_match("#\<table id=\"details\"\>.*?<br />(.*?)\<tr\>\<td class=\"header\"\>#si", $copy_page, $copy_post);
   preg_match ("#<title>rutor.org :: (.*?)</title>#si", $copy_page, $r_title);

71.   $copy_release = $copy_post[1];

   $text = preg_replace("#<a href=\"(.*?)\".*?>(.*?)</a>#si", "[url=\\1]\\2[/url]", $copy_release);
   $text = preg_replace("#<img src=\"(\S*?)\" style=\"float:(.*?);\" />#si", "[img=\\2]\\1[/img]", $text);
   $text = preg_replace("#<img src=\"(\S*?)\" />#si", "[img]\\1[/img]", $text);
   $text = preg_replace("#<hr />#si", "[hr]", $text);

   //hide
   while (preg_match("#<div class=\"hidewrap\">.*?this\)\)\">(.*?)</div>.*?<textarea class=\"hidearea\">(.*?)</textarea></div>#sie", $text, $match))
   {
     $replace = "[spoiler=\"".strip_tags($match[1])."\"]".$match[2]."[/spoiler]";
     $search = "|".preg_quote($match[0])."|si";
     $text = preg_replace($search, $replace, $text);
   }
PHP:
    if ($gettorrent === 1) {
        preg_match ("#<a href=\"(http:\/\/d\.rutor\.org\/download\/\d+)\"#si", $copy_page, $r_torrent);
        $torrent_url = $r_torrent[1];
        $options_torrent = array(CURLOPT_URL => $torrent_url);
        $torrent_hidden = get_torrent($options_torrent);
    }else {
        $torrent_hidden = '';
    }

125.    $pars_data = array("title" => $r_title[1], "bbcode" => strip_tags($text), "hidden" => $torrent_hidden);
    return $pars_data;

}

Движок 2.1.5 чистый
 

Nikita11

Пользователь
Не парсит с рутора и с нонейма. С рутрекера всё нормально. При попытке парсинга с рутора вываливает нотисы:

Код:
Notice: Undefined offset: 1 in /var/www/library/includes/functions_parser.php on line 71

Notice: Undefined offset: 1 in /var/www/library/includes/functions_parser.php on line 125

PHP:
function parse_rutor($url, $gettorrent)
{
   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_USERAGENT, 'IE20');
   curl_setopt($ch, CURLOPT_HEADER, 0);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, '1');
   $copy_page = curl_exec($ch);
   curl_close($ch);
  
   preg_match("#\<table id=\"details\"\>.*?<br />(.*?)\<tr\>\<td class=\"header\"\>#si", $copy_page, $copy_post);
   preg_match ("#<title>rutor.org :: (.*?)</title>#si", $copy_page, $r_title);

71.   $copy_release = $copy_post[1];

   $text = preg_replace("#<a href=\"(.*?)\".*?>(.*?)</a>#si", "[url=\\1]\\2[/url]", $copy_release);
   $text = preg_replace("#<img src=\"(\S*?)\" style=\"float:(.*?);\" />#si", "[img=\\2]\\1[/img]", $text);
   $text = preg_replace("#<img src=\"(\S*?)\" />#si", "[img]\\1[/img]", $text);
   $text = preg_replace("#<hr />#si", "[hr]", $text);

   //hide
   while (preg_match("#<div class=\"hidewrap\">.*?this\)\)\">(.*?)</div>.*?<textarea class=\"hidearea\">(.*?)</textarea></div>#sie", $text, $match))
   {
     $replace = "[spoiler=\"".strip_tags($match[1])."\"]".$match[2]."[/spoiler]";
     $search = "|".preg_quote($match[0])."|si";
     $text = preg_replace($search, $replace, $text);
   }
PHP:
    if ($gettorrent === 1) {
        preg_match ("#<a href=\"(http:\/\/d\.rutor\.org\/download\/\d+)\"#si", $copy_page, $r_torrent);
        $torrent_url = $r_torrent[1];
        $options_torrent = array(CURLOPT_URL => $torrent_url);
        $torrent_hidden = get_torrent($options_torrent);
    }else {
        $torrent_hidden = '';
    }

125.    $pars_data = array("title" => $r_title[1], "bbcode" => strip_tags($text), "hidden" => $torrent_hidden);
    return $pars_data;

}

Движок 2.1.5 чистый

Знаешь я тоже долго мучилься с аналогчной проблемой. Могу предложить как вариант перенастроить на крутор или фрутор с них вместе с файлом парситься.
 
Сверху