Example #1
0
 function ct()
 {
     $path_edit = "/home/salorium/rtorrent/data/Alaska.La.ruee.vers.l.or.S04E03.avi";
     $piece_size = "512";
     $callback_log = create_function('$msg', 'echo $msg');
     $callback_err = create_function('$msg', 'echo $msg;');
     $torrent = new \model\simple\Torrent($path_edit, array(), $piece_size, $callback_log, $callback_err);
     $torrent->is_private(true);
     var_dump($torrent->info['name']);
     var_dump($torrent);
 }
Example #2
0
 function trackerUptorrent($user)
 {
     \core\Mysqli::$default = "gazelle";
     $u = Utilisateur::getUtilisteur($user);
     if ($u) {
         \config\Conf::$torrentpass = $u->torrentpass;
         if (isset($_FILES["torrent"])) {
             if ($_FILES["torrent"]["error"] > 0) {
             } else {
                 $torrent = new Torrent(file_get_contents($_FILES["torrent"]["tmp_name"]));
                 if (!$torrent->errors()) {
                     $torrent->is_private(true);
                     $torrent->announce("");
                     $hash = pack("H*", $torrent->hash_info());
                     $a = \model\mysql\Torrents::insertTorrent($hash, $torrent->__toString());
                     if (!is_bool($a)) {
                         $az = \model\ocelot\Requete::addTorrent($a, $hash, "0");
                     }
                 }
             }
         }
     } else {
         throw new \Exception("Pas d'utilisateur");
     }
 }