summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-09-15 02:02:19 +0200
committerHorus32014-09-15 02:02:19 +0200
commit1b65668acfc7bec3d961d54a99db8950f8d8115e (patch)
tree09e1655eefaff9f2b7521a083f3a3cb30cc33f6f
parent93b2daff3db922541e3cd1cb59081f15025439c8 (diff)
downloadvideo-dl-1b65668acfc7bec3d961d54a99db8950f8d8115e.tar.gz
'check back later' message for audio extraction added.
-rw-r--r--dl.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/dl.php b/dl.php
index 3fd0753..3ae986c 100644
--- a/dl.php
+++ b/dl.php
@@ -85,6 +85,9 @@ switch($_GET["task"]){
case("xtau"): /* extracting audio */
ignore_user_abort(true);
+ if(file_exists($CACHEDIR."/".$info[2].".audio.txt"))
+ failure('<h3>Already processing the request. Check back later.</h3><br><img src="/static/ajax-loader.gif" alt="ajax-loader"/>', false);
+
# get file information
exec("youtube-dl -x --get-filename --output ".escapeshellarg($CACHEDIR."/".$info[2].".%(ext)s") . " ".escapeshellarg($info[0]), $output, $ret);
if($ret != 0)
@@ -92,8 +95,8 @@ switch($_GET["task"]){
# file name with correct extension, but cache dir at first
$file = $output[0];
-
- if(!file_exists($file) || !file_exists($CACHEDIR."/".$info[2].".audio.txt")){
+
+ if(!file_exists($file)){
$ret = video_xt_audio($info[0], $CACHEDIR, $info[2]);
if(!$ret)
failure("Fetching the video failed.", true);