From b44a26eb73010260922d242875a3b4773936a084 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Sep 2014 15:04:39 +0200 Subject: f5 protection and improved UI --- dl.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dl.php') diff --git a/dl.php b/dl.php index 3fd0753..0cf9f59 100644 --- a/dl.php +++ b/dl.php @@ -120,7 +120,7 @@ switch($_GET["task"]){ case("stream"): ignore_user_abort(true); if(file_exists($CACHEDIR."/".$info[2].".txt")) - failure('

Already processing the request. Check back later.


This is very cpu intensive operation, so thanks for your understanding.


ajax-loader', false); + failure('

Stream: Already processing the request.

This page will refresh when the task is done.


ajax-loader', false); # send 'cached' response in case we already have the video on disk if(file_exists($CACHEDIR."/".$info[2]) && !file_exists($CACHEDIR."/".$info[2].".txt")){ echo "cached"; @@ -151,20 +151,20 @@ switch($_GET["task"]){ } */ if(file_exists($CACHEDIR."/".$info[2].".webm.txt")) - failure('

Already processing the request. Check back later.


( This is very cpu intensive operation, so thanks for your understanding. )


ajax-loader', false); + failure('

Convert: Already processing the request.

This page will refresh when the task is done.


( This is a very cpu intensive operation, so it may take a while. )


ajax-loader', false); if(file_exists($CACHEDIR."/".$info[2]."webm")){ echo "cached"; exit; } else { - if(!convert_video($CACHEDIR, $info[2])) + $finfo = new finfo(FILEINFO_MIME_TYPE); + $mime = $finfo->file($CACHEDIR . "/" . $info[2]); + + if(!convert_video($CACHEDIR, $info[2], $mime)) failure("Converting video failed.", false); else unlink($CACHEDIR."/".$info[2].".webm.txt"); } - $finfo = new finfo(FILEINFO_MIME_TYPE); - $mime = $finfo->file($CACHEDIR . "/" . $info[2]); - pr_player(htmlentities($CACHEDIR . "/" . $info[2]), htmlentities($info[4]), htmlentities($mime), htmlentities($info[1]), htmlentities($info[2]), true); break; -- cgit v1.2.3