Esempio n. 1
0
 function processTd($html, &$movie)
 {
     $res = $html->find('a', 2);
     if (!$res) {
         return false;
     }
     $movie['link'] = RUTORROOT . $res->href;
     if (trySkip($movie)) {
         return false;
     }
     $title = html_entity_decode($res->plaintext, ENT_QUOTES, "UTF-8");
     $movie['description'] = $title;
     $pos = strrpos($title, ' / ') + 3;
     if ($pos > 4) {
         $title = trim(substr($title, $pos));
     }
     $result = array();
     $res1 = preg_match_all('/\\[S\\d+/isU', $title, $result, PREG_OFFSET_CAPTURE);
     $res2 = preg_match_all('/\\[[\\d\\-x ,из]+\\]/isU', $title, $result, PREG_OFFSET_CAPTURE);
     if ($res1 || $res2) {
         //that's a series
         $this->logger->info("skip series: " . $title);
         return false;
     }
     $res1 = preg_match_all('/\\| трейлер/isuU', $title, $result, PREG_OFFSET_CAPTURE);
     if ($res1) {
         //that's a trailer
         $this->logger->info("skip trailer: " . $title);
         return false;
     }
     extractString($title, $movie);
     extractTranslate($title, $movie);
     return true;
 }
Esempio n. 2
0
 function processTd($html, &$movie)
 {
     $res = str_get_html($html)->find('a', 0);
     if (!$res) {
         return false;
     }
     $movie['link'] = "http://nnm-club.me/forum/" . $res->href;
     if (trySkip($movie)) {
         return false;
     }
     $title = html_entity_decode($res->plaintext, ENT_QUOTES, "UTF-8");
     $movie['description'] = $title;
     $result = array();
     $res1 = preg_match_all('/\\[S\\d+/isU', $title, $result, PREG_OFFSET_CAPTURE);
     $res2 = preg_match_all('/\\[[\\d-x ,]+\\]/isU', $title, $result, PREG_OFFSET_CAPTURE);
     if ($res1 || $res2) {
         //that's a series
         $this->logger->info("skip series: " . $title);
         return false;
     }
     extractTranslate($title, $movie);
     $pos = strpos($title, '[');
     if ($pos !== FALSE) {
         $title = trim(substr($title, 0, $pos));
     }
     $pos = strrpos($title, '/') + 1;
     if ($pos > 4) {
         $title = trim(substr($title, $pos));
     }
     extractString($title, $movie);
     return true;
 }
Esempio n. 3
0
function processTd($html, &$movie)
{
    $res = $html->find('a', 0);
    if (!$res) {
        return false;
    }
    $movie['link'] = "http://www.seedoff.net" . $res->href;
    if (trySkip($movie)) {
        return false;
    }
    $title = html_entity_decode($res->plaintext, ENT_QUOTES, "UTF-8");
    $movie['description'] = $title;
    $pos = strrpos($title, '/') + 1;
    $title = trim(substr($title, $pos));
    extractString($title, $movie);
    extractTranslate($title, $movie);
    return true;
}
Esempio n. 4
0
 function processTd($html, &$movie)
 {
     $res = $html->find('div.detName a', 0);
     if (!$res) {
         return false;
     }
     $link = PIRATEROOT . $res->href;
     $movie['link'] = $link;
     if (trySkip($movie)) {
         return false;
     }
     $movie['description'] = html_entity_decode($res->plaintext, ENT_QUOTES, "UTF-8");
     extractString($res->plaintext, $movie);
     $res = $html->find('font.detDesc', 0);
     if (!$res) {
         return false;
     }
     $this->processDesc($res->plaintext, $movie);
     return true;
 }
Esempio n. 5
0
function updateLinks()
{
    global $logger;
    $logger->info('UPDATE LINKS');
    $resPirate = array();
    //parallel RollingCurl
    RollingCurl::$rc = new RollingCurl("main_callback");
    // the window size determines how many simultaneous requests to allow.
    RollingCurl::$rc->window_size = 5;
    //List of tracker loaders
    $loaders = array();
    $rutorMain = RUTORROOT;
    $loaders[] = new RutorLoader("{$rutorMain}/browse/0/1/0/2/");
    //foreign movies
    $loaders[] = new RutorLoader("{$rutorMain}/browse/1/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/2/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/3/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/4/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/5/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/6/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/7/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/8/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/9/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/10/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/11/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/12/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/13/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/0/7/0/2/");
    //multiplication
    $loaders[] = new RutorLoader("{$rutorMain}/browse/0/5/0/2");
    //russian movies
    $loaders[] = new RutorLoader("{$rutorMain}/browse/1/5/0/2");
    $NNMData = array("prev_sd" => 0, "prev_a" => 0, "prev_my" => 0, "prev_n" => 0, "prev_shc" => 0, "prev_shf" => 1, "prev_sha" => 1, "prev_shs" => 0, "prev_shr" => 0, "prev_sht" => 0, "f[0]" => 270, "o" => 10, "s" => 2, "tm" => -1, "ta" => -1, "sns" => -1, "sds" => -1, "nm" => "", "pn" => "");
    $loaders[] = new NNMLoader("http://nnm-club.me/forum/tracker.php", $NNMData);
    $NNMData["f[0]"] = 218;
    $loaders[] = new NNMLoader("http://nnm-club.me/forum/tracker.php", $NNMData);
    $NNMData["f[0]"] = 217;
    $NNMData["f[1]"] = 954;
    $loaders[] = new NNMLoader("http://nnm-club.me/forum/tracker.php", $NNMData);
    $pirateMain = PIRATEROOT;
    $loaders[] = new PirateLoader("{$pirateMain}/browse/201/0/7/0");
    /*
    $resPirate1 = new Pirate;
    $resPirate1->getPirateBay("https://pirateproxy.sx/browse/207/0/7");
    $resPirate2 = new Pirate;
    $resPirate2->getPirateBay("https://pirateproxy.sx/browse/207/1/7");
    $resPirate3 = new Pirate;
    $resPirate3->getPirateBay("https://pirateproxy.sx/browse/201/0/7");
    $resPirate = array_merge($resPirate1->result, $resPirate2->result, $resPirate3->result, $resRutor, $resSeedoff);
    flush();
    */
    foreach ($loaders as $loader) {
        $loader->setLogger($logger);
        $loader->load();
    }
    RollingCurl::$rc->execute();
    //result array with torrent infos
    $result = array();
    foreach ($loaders as $loader) {
        $result = array_merge($result, $loader->getResult());
    }
    $resSeedoff = array();
    $resSeedoff = seedoff\getSeedoff();
    $resSeedoff = array_merge($resSeedoff, seedoff\getSeedoff("http://www.seedoff.net/index.php?page=ajax&active=0&options=0&recommend=0&sticky=0&period=0&category=14&options=0&order=5&by=2&pages=2"));
    $resSeedoff = array_merge($resSeedoff, seedoff\getSeedoff("http://www.seedoff.net/index.php?page=ajax&active=0&options=0&recommend=0&sticky=0&period=0&category=14&options=0&order=5&by=2&pages=3"));
    $resSeedoff = array_merge($resSeedoff, seedoff\getSeedoff("http://www.seedoff.net/index.php?page=ajax&active=0&options=0&recommend=0&sticky=0&period=0&category=64&options=0&order=5&by=2&pages=1"));
    $result = array_merge($result, $resSeedoff);
    foreach ($result as $cur) {
        if (trySkip($cur)) {
            continue;
        }
        getIds($cur['title_approx'], $cur);
        $logger->info("add link: " . $cur['title_approx'] . "::" . $cur['description'] . "::" . $cur['link']);
        $res = addLink($cur);
        if ($res !== 0) {
            $logger->warning("link was not added: {$res}");
        }
        usleep(100 * 1000);
    }
    $logger->info(count($result) . " links updated");
}