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

Started by Lektor on 2015-01-15 01:42 — 403 replies, 76419 views

#201
Я не понял это можно сделать или нет?
Можно
#202
если у кого-то есть другие трекеры по типу тапочек, тфайл можете выложить?
#203
@v3xxx1 а самому ? Много каких трекеров написано)
#204
@v3xxx1 а самому ? Много каких трекеров написано)
пробовал с соседней темы парсер, пишет false content... А самому не судьба)
#205
не работают опции для галок, что нужно исправить?
#206
как избавится от http://assets.nnm-club.ws/forum/image.php?link= в парсере с Торрент-трекер :: NNM-Club
вот так парсит картинки:
#207
@viktor я бы сделал примерно так
preg_replace('#http:\/\/assets.nnm-club.ws\/forum\/image\.php\?link=#', '', $text);
#208
спасибо большое за помощь. работает. а с торент файлом не поможете? не цепляет. надо ручками добавлять
#209
при парсинге nnm все время нотис functions_parser.php on line 41...

по строке 41 это - if ($gettorrent === 1) {
#210
@viktor разбираться в устройстве парсера мне в ломы, поэтому пишем костыль:
в файле functions_parser.php в функции parse_nnm находим:
if ($gettorrent === 1) {
        preg_match ("#<a href=\"download.php\?id=(\d+)\" rel=\"nofollow\">#si", $topic, $r_torrent);
        $torrent_url = "http://nnm-club.me/forum/download.php?id=".$r_torrent[1];

        $options_torrent = array(CURLOPT_URL => $torrent_url,
                       CURLOPT_REFERER => "http://nnm-club.me/forum/download.php?id=".$r_torrent[1],
                CURLOPT_COOKIEFILE => $cookie_file,
                CURLOPT_COOKIEJAR => $cookie_file);
        $torrent_hidden = get_torrent($options_torrent);
    }else {
        $torrent_hidden = '';
    }
заменяем на
if ($gettorrent === 1) {
        preg_match ("#<a href=\"download.php\?id=(\d+)\" rel=\"nofollow\">#si", $topic, $r_torrent);
        $torrent_url = "http://nnm-club.me/forum/download.php?id=".$r_torrent[1];

        /*$options_torrent = array(CURLOPT_URL => $torrent_url,
                       CURLOPT_REFERER => "http://nnm-club.me/forum/download.php?id=".$r_torrent[1],
                CURLOPT_COOKIEFILE => $cookie_file,
                CURLOPT_COOKIEJAR => $cookie_file);
        $torrent_hidden = get_torrent($options_torrent);*/
        $torrent = file_get_contents($torrent_url);
        $tor = bdecode($torrent);

        $name = md5($torrent);

        if(count($tor))
        {
            $new_name = md5($torrent);
            $file = fopen('data/old_files/'. $new_name .'.torrent', 'w');
            fputs($file, $torrent);
            fclose($file);
             
            $torrent_hidden = '<input type="hidden" name="add_attachment_body" value="0" />';
            $torrent_hidden .= '<input type="hidden" name="posted_attachments_body" value="0" />';
            $torrent_hidden .= '<input type="hidden" name="attachment_list[]" value="data/old_files/'. $new_name .'.torrent" />';
            $torrent_hidden .= '<input type="hidden" name="filename_list[]" value="'. $name .'.torrent" />';
            $torrent_hidden .= '<input type="hidden" name="extension_list[]" value="torrent" />';
            $torrent_hidden .= '<input type="hidden" name="mimetype_list[]" value="application/x-bittorrent" />';
            $torrent_hidden .= '<input type="hidden" name="filesize_list[]" value="'. filesize('data/old_files/'. $new_name .'.torrent') .'" />';
            $torrent_hidden .= '<input type="hidden" name="filetime_list[]" value="'. TIMENOW .'" />';
            $torrent_hidden .= '<input type="hidden" name="attach_id_list[]" value="" />';
            $torrent_hidden .= '<input type="hidden" name="attach_thumbnailsnail_list[]" value="" />';
        }
    }else {
        $torrent_hidden = '';
    }
P.S. Не проверял, так что если какие ошибки, отписывай сюда