Repository navigation
Expand file tree
/
Copy pathwget.php
More file actions
80 lines (57 loc) · 1.94 KB
/
Copy pathwget.php
File metadata and controls
80 lines (57 loc) · 1.94 KB
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
<?php
/*
Created @ 20.10.2010 by TheFox@fox21.at
Copyright (c) 2010 TheFox
This file is part of PHPDL.
PHPDL is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
PHPDL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PHPDL. If not, see <http://www.gnu.org/licenses/>.
*/
define('ANTIHACK', 1);
if(isset($_SERVER['SERVER_ADDR'])) die('Hacking attempt.');
include_once('./lib/config.php');
include_once('./lib/functions.php');
include_once('./lib/class.dlfile.php');
if(count($argv) >= 2){
$fileId = (int)$argv[1];
if(!$fileId)
exit();
print "file id: $fileId\n";
$dbh = dbConnect();
$file = new dlfile($CONFIG['DB_HOST'], $CONFIG['DB_NAME'], $CONFIG['DB_USER'], $CONFIG['DB_PASS']);
$hosters = getDbTable($dbh, 'hosters');
dbClose($dbh);
if($file->loadById($fileId)){
#$file = $files[$fileId];
print "uri: '".$file->get('uri')."'\n";
$thisHoster = null;
foreach($hosters as $id => $thisHoster)
if(preg_match('/'.$thisHoster['searchPattern'].'/i', $file->get('uri')))
break;
if($thisHoster){
print "hoster found\n";
$libThisHosterPath = './lib/hoster/'.$thisHoster['phpPath'];
if(file_exists($libThisHosterPath)){
include_once($libThisHosterPath);
print "hoster plugin loaded\n";
if(function_exists('hosterExec'))
hosterExec($file, $thisHoster);
print "hoster plugin: hosterExec done\n";
}
else
print "ERROR: '$libThisHosterPath' not found\n";
}
else
print "ERROR: no hoster found\n";
}
else
print "ERROR: file not found\n";
}
?>