forked from lirix360/TorrentMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.php
executable file
·92 lines (81 loc) · 3 KB
/
engine.php
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
////////////////////////////////////
///////////TorrentMonitor///////////
////////////////////////////////////
$dir = dirname(__FILE__).'/';
include_once $dir.'config.php';
include_once $dir.'class/System.class.php';
include_once $dir.'class/Database.class.php';
include_once $dir.'class/Errors.class.php';
include_once $dir.'class/Notification.class.php';
header('Content-Type: text/html; charset=utf-8');
if (Sys::checkConfig())
{
if (Sys::checkCurl())
{
$torrentsList = Database::getTorrentsList('name');
$count = count($torrentsList);
for ($i=0; $i<$count; $i++)
{
$tracker = $torrentsList[$i]['tracker'];
if (Database::checkTrackersCredentialsExist($tracker))
{
$engineFile = $dir.'trackers/'.$tracker.'.engine.php';
if (file_exists($engineFile))
{
Database::clearWarnings('system');
$functionEngine = include_once $engineFile;
$class = explode('.', $tracker);
$class = $class[0];
$functionClass = str_replace('-', '', $class);
if ($tracker == 'lostfilm.tv' || $tracker == 'novafilm.tv' || $tracker == 'baibako.tv' || $tracker == 'newstudio.tv')
{
call_user_func($functionClass.'::main', $torrentsList[$i]['id'], $tracker, $torrentsList[$i]['name'], $torrentsList[$i]['hd'], $torrentsList[$i]['ep'], $torrentsList[$i]['timestamp'], $torrentsList[$i]['hash']);
}
if ($tracker == 'rutracker.org' || $tracker == 'nnm-club.me' || $tracker == 'rutor.org' || $tracker == 'tfile.me' || $tracker == 'kinozal.tv' || $tracker == 'anidub.com' || $tracker == 'casstudio.tv')
{
call_user_func($functionClass.'::main', $torrentsList[$i]['id'], $tracker, $torrentsList[$i]['name'], $torrentsList[$i]['torrent_id'], $torrentsList[$i]['timestamp'], $torrentsList[$i]['hash']);
}
$functionClass = NULL;
$functionEngine = NULL;
}
else
Errors::setWarnings('system', 'missing_files');
}
else
Errors::setWarnings('system', 'credential_miss');
}
$usersList = Database::getUserToWatch();
$count = count($usersList);
for ($i=0; $i<$count; $i++)
{
$tracker = $usersList[$i]['tracker'];
if (Database::checkTrackersCredentialsExist($tracker))
{
$serchFile = $dir.'trackers/'.$tracker.'.search.php';
if (file_exists($serchFile))
{
Database::clearWarnings('system');
$functionEngine = include_once $serchFile;
$class = explode('.', $tracker);
$class = $class[0];
$class = str_replace('-', '', $class);
$functionClass = $class.'Search';
call_user_func($functionClass .'::mainSearch', $usersList[$i]['id'], $tracker, $usersList[$i]['name']);
$functionClass = NULL;
$functionEngine = NULL;
}
else
Errors::setWarnings('system', 'missing_files');
}
else
Errors::setWarnings('system', 'credential_miss');
}
Sys::lastStart();
}
else
Errors::setWarnings('system', 'curl');
}
else
echo 'Для корректной работы необходимо внести изменения в конфигурационный файл.';
?>