summaryrefslogtreecommitdiff
path: root/dl.php
diff options
context:
space:
mode:
Diffstat (limited to 'dl.php')
-rw-r--r--dl.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/dl.php b/dl.php
index a3cdcdd..ba35a1d 100644
--- a/dl.php
+++ b/dl.php
@@ -81,6 +81,7 @@ switch($_GET["task"]){
break;
case("xtau"): /* extracting audio */
+ ignore_user_abort(true);
# get file information
exec("youtube-dl -x --get-filename --output ".escapeshellarg($CACHEDIR."/".$info[2].".%(ext)s") . " ".escapeshellarg($info[0]), $output, $ret);
if($ret != 0)
@@ -89,10 +90,12 @@ switch($_GET["task"]){
# file name with correct extension, but cache dir at first
$file = $output[0];
- if(!file_exists($file)){
+ if(!file_exists($file) || !file_exists($CACHEDIR."/".$info[2].".audio.txt")){
$ret = video_xt_audio($info[0], $CACHEDIR, $info[2]);
if(!$ret)
failure("Fetching the video failed.", true);
+ else
+ unlink($CACHEDIR."/".$info[2].".audio.txt");
}
$finfo = new finfo(FILEINFO_MIME_TYPE);