Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/240.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php UDP跟踪器抓取1个脚本不工作_Php_Udp_Scrape_Bittorrent - Fatal编程技术网

Php UDP跟踪器抓取1个脚本不工作

Php UDP跟踪器抓取1个脚本不工作,php,udp,scrape,bittorrent,Php,Udp,Scrape,Bittorrent,使用此脚本时,我的跟踪器仅从http跟踪器更新种子和种子。我的torrent的第一个跟踪器仅更新种子和种子 print("<tr><td class='desc'><b>" .T_("Torrent Stats"). ": </b></td><td valign='top' class='lista'>"); $seeders1 = $leechers1 = $downloaded1 = null;

使用此脚本时,我的跟踪器仅从http跟踪器更新种子和种子。我的torrent的第一个跟踪器仅更新种子和种子

print("<tr><td class='desc'><b>" .T_("Torrent Stats"). ": </b></td><td valign='top' class='lista'>");
        $seeders1 = $leechers1 = $downloaded1 = null;

        $tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
        while ($trow = mysql_fetch_assoc($tres)) {
            $ann = $trow["url"];
            $tracker = explode("/", $ann);
            $path = array_pop($tracker);
            $oldpath = $path;
            $path = preg_replace("/^announce/", "scrape", $path);
            $tracker = implode("/", $tracker)."/".$path;

            if ($oldpath == $path) {
                continue; // Scrape not supported, ignored
            }

            // TPB's tracker is dead. Use openbittorrent instead
            if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker)) {
                $tracker = "http://tracker.openbittorrent.com/scrape";
            }

            $stats = torrent_scrape_url($tracker, $row["info_hash"]);
            if ($stats['seeds'] != -1) {
                $seeders1 += $stats['seeds'];
                $leechers1 += $stats['peers'];
                $downloaded1 += $stats['downloaded'];
                SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = $stats[seeds], `leechers` = $stats[peers], `times_completed` = $stats[downloaded] WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
            } else {
                SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

            }
        }

如果$id是一个php变量,这应该可以工作。问题是您正在向UDP跟踪器发送http-
scrap


UDP跟踪器使用完全不同的协议:

使用此协议,它只会刮取公告中的第一个url&如果它的HTTP只有那么如果它的UDP那么它就不会刮取。我想使用类似这样的东西,以便它可以刮取torrent$res=mysql\u查询中的整个跟踪器(“从torrents中选择id,info_hash,其中external='yes'顺序通过添加DESC LIMIT 25”);$TorrentInfo=ParseTorrent($site_config[torrent_dir]/$row[id].torrent”);$ann=$TorrentInfo[0];$annlist=array();if($TorrentInfo[6]){foreach($TorrentInfo[6]as$ann){$annelse$annlist=数组($ann);
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=".$id.";");