mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 13:32:41 +08:00
fix rss download link + migrate bencode to rhilip/bencode
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
require_once('../include/bittorrent_announce.php');
|
||||
require_once('../include/benc.php');
|
||||
//require_once('../include/benc.php');
|
||||
dbconn_announce();
|
||||
|
||||
// BLOCK ACCESS WITH WEB BROWSERS AND CHEATS!
|
||||
@@ -24,13 +24,14 @@ if (mysql_num_rows($res) < 1){
|
||||
err("Torrent not registered with this tracker.");
|
||||
}
|
||||
|
||||
$torrent_details = [];
|
||||
while ($row = mysql_fetch_assoc($res)) {
|
||||
$r .= "20:" . hash_pad($row["info_hash"]) . "d" .
|
||||
benc_str("complete") . "i" . $row["seeders"] . "e" .
|
||||
benc_str("downloaded") . "i" . $row["times_completed"] . "e" .
|
||||
benc_str("incomplete") . "i" . $row["leechers"] . "e" .
|
||||
"e";
|
||||
$torrent_details[$row['info_hash']] = [
|
||||
'complete' => (int)$row['seeders'],
|
||||
'downloaded' => (int)$row['times_completed'],
|
||||
'incomplete' => (int)$row['leechers']
|
||||
];
|
||||
}
|
||||
$r .= "ee";
|
||||
|
||||
benc_resp_raw($r);
|
||||
$d = ['files' => $torrent_details];
|
||||
benc_resp($d);
|
||||
|
||||
Reference in New Issue
Block a user