summaryrefslogtreecommitdiff
path: root/dl.php
diff options
context:
space:
mode:
authormoehm2014-09-14 21:29:39 +0200
committermoehm2014-09-14 21:29:39 +0200
commitf4c4a9791a90c51b1699d5d178199318a2ca2a85 (patch)
treeab0b0de6ec10cc9baa4cd31875a7fba1e1b24610 /dl.php
parent1eba482c5172a92432c13e04480cb1604bef6df0 (diff)
downloadvideo-dl-f4c4a9791a90c51b1699d5d178199318a2ca2a85.tar.gz
removed limit for downloads + blocks double audio extracting
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);