summaryrefslogtreecommitdiff
path: root/mirror.php
diff options
context:
space:
mode:
Diffstat (limited to 'mirror.php')
-rw-r--r--mirror.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/mirror.php b/mirror.php
index 8701035..0cc2836 100644
--- a/mirror.php
+++ b/mirror.php
@@ -74,6 +74,14 @@
}
}
if (! file_exists($pfad)) {
+ $size = shell_exec(
+ "curl -ILs -A 'Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0' '".$quelle."' " .
+ "| sed '" .
+ "s/^Content-Length: //;t;d" .
+ "'"
+ );
+ if (! empty($size))
+ header('Content-Length: ' . $size);
passthru(
"mkdir -p '".dirname($pfad)."'; ".
"( ".
@@ -85,6 +93,7 @@
);
}
else {
+ header('Content-Length: ' . $stat['size']);
$handle = fopen($pfad);
fpassthru($handle);
fclose($handle);