-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscrape.php
More file actions
39 lines (33 loc) · 986 Bytes
/
scrape.php
File metadata and controls
39 lines (33 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Copyright 2012, openTracker. (http://opentracker.nu)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @link http://opentracker.nu openTracker Project
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
* @author Wuild
* @package openTracker
*/
/**
* filename scrape.php
*
* @author Wuild
* @package openTracker
*/
include("init.php");
$r = 'd5:files';
if (isset($_GET['info_hash'])) {
$db = new DB("torrents");
$db->setColPrefix("torrent_");
$db->select("torrent_info_hash = '" . $db->escape(bin2hex($_GET['info_hash'])) . "'");
while ($db->nextRecord()) {
$r .= '20:' . str_pad($db->info_hash, 20) . 'd8:completei' . $db->seeders . 'e10:downloadedi' . $db->times_completed . 'e10:incompletei' . $db->leechers . 'ee';
}
}
$r .= 'ee';
header('Content-Type: text/plain; charset=UTF-8');
header('Pragma: no-cache');
print($r);
?>