diff options
| author | root | 2014-09-15 00:43:22 +0200 |
|---|---|---|
| committer | root | 2014-09-15 00:43:22 +0200 |
| commit | 93b2daff3db922541e3cd1cb59081f15025439c8 (patch) | |
| tree | fbdbe33e13df7a5da17f14d3a75bd44c51b1b31c /dl.php | |
| parent | dfc4ee6bfbff601328f6bf8dadf9716a58cbd903 (diff) | |
| download | video-dl-93b2daff3db922541e3cd1cb59081f15025439c8.tar.gz | |
fixed typos and improved usability
Diffstat (limited to 'dl.php')
| -rw-r--r-- | dl.php | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -120,7 +120,7 @@ switch($_GET["task"]){ case("stream"): ignore_user_abort(true); if(file_exists($CACHEDIR."/".$info[2].".txt")) - failure('Already doing the request.', false); + failure('<h3>Already processing the request. Check back later.</h3><br><p>This is very cpu intensive operation, so thanks for your understanding.</p><br><img src="/static/ajax-loader.gif" alt="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"; @@ -132,7 +132,6 @@ switch($_GET["task"]){ failure("Fetching the video failed.", false); else unlink($CACHEDIR."/".$info[2].".txt"); - } break; case("player"): @@ -144,21 +143,25 @@ switch($_GET["task"]){ break; case("convert"): + ignore_user_abort(true); + /* $dir = array_diff(scandir($CACHEDIR), array('.', '..')); if(!in_array($_GET['vid'], $dir)){ - failure('Video not found.' false); + failure('Video not found.', false); } + */ if(file_exists($CACHEDIR."/".$info[2].".webm.txt")) - exit; + failure('<h3>Already processing the request. Check back later.</h3><br><p>( This is very cpu intensive operation, so thanks for your understanding. )</p><br><img src="/static/ajax-loader.gif" alt="ajax-loader"/>', false); if(file_exists($CACHEDIR."/".$info[2]."webm")){ echo "cached"; exit; - } - if(!convert_video($info[2])) - failure("Converting video failed.", false); - else - unlink($CACHEDIR."/".$info[2].".webm.txt"); + } else { + if(!convert_video($CACHEDIR, $info[2])) + failure("Converting video failed.", false); + else + unlink($CACHEDIR."/".$info[2].".webm.txt"); + } $finfo = new finfo(FILEINFO_MIME_TYPE); $mime = $finfo->file($CACHEDIR . "/" . $info[2]); |
