wget option for transloading
git-svn-id: file:///home/shish/svn/shimmie2/trunk@682 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
19d80a244f
commit
b632c92d25
@ -56,7 +56,8 @@ class Upload extends Extension {
|
||||
$sb->add_choice_option("transload_engine", array(
|
||||
"Disabled" => "none",
|
||||
"cURL" => "curl",
|
||||
"fopen" => "fopen"
|
||||
"fopen" => "fopen",
|
||||
"WGet" => "wget"
|
||||
), "<br>Transload: ");
|
||||
$event->panel->add_block($sb);
|
||||
}
|
||||
@ -150,6 +151,13 @@ class Upload extends Extension {
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if($config->get_string("transload_engine") == "wget") {
|
||||
$ua = "Shimmie-".VERSION;
|
||||
$s_url = escapeshellarg($url);
|
||||
$s_tmp = escapeshellarg($tmp_filename);
|
||||
system("wget $s_url --output-document=$s_tmp --user-agent=$ua --referer=$s_url");
|
||||
}
|
||||
|
||||
if(filesize($tmp_filename) == 0) {
|
||||
$this->theme->display_upload_error($page, "Error with ".html_escape($filename),
|
||||
"No data found -- perhaps the site has hotlink protection?");
|
||||
|
Loading…
x
Reference in New Issue
Block a user