summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoehm2014-09-14 21:29:39 +0200
committermoehm2014-09-14 21:29:39 +0200
commitf4c4a9791a90c51b1699d5d178199318a2ca2a85 (patch)
treeab0b0de6ec10cc9baa4cd31875a7fba1e1b24610
parent1eba482c5172a92432c13e04480cb1604bef6df0 (diff)
downloadvideo-dl-f4c4a9791a90c51b1699d5d178199318a2ca2a85.tar.gz
removed limit for downloads + blocks double audio extracting
-rw-r--r--config.php3
-rw-r--r--dl.php5
-rw-r--r--func.php7
-rw-r--r--index.php4
4 files changed, 15 insertions, 4 deletions
diff --git a/config.php b/config.php
index 56b3e2e..db92fc9 100644
--- a/config.php
+++ b/config.php
@@ -7,7 +7,8 @@ $ABSCACHEDIR = $ABSPATH . "/" . $CACHEDIR;
$REDIS_DBNAME=0;
$REDIS_CONNECT="/var/run/redis/redis.sock";
-$MAXSIZE = 500000000000;
+//$MAXSIZE = 500000000000;
+$MAXSIZE= 2000000000000;
$STREAM_MAXSIZE = 200000000;
//$db = new SQLite3($ABSPATH . "/db/sqlite.db");
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);
diff --git a/func.php b/func.php
index 6ad7894..3c6adb7 100644
--- a/func.php
+++ b/func.php
@@ -39,7 +39,7 @@ function vid_info($url){
function video_dl($VIDEO, $CACHEDIR, $FILENAME){
$fp=fopen($CACHEDIR."/".$FILENAME.".txt", "w");
- $content="downloading ".$FILENAME."\n";
+ $content="downloading: ".$FILENAME."\n";
fputs($fp, $content);
fclose($fp);
exec("youtube-dl --no-part --output '".$CACHEDIR."/".$FILENAME."' '$VIDEO'", $pid, $ret);
@@ -52,6 +52,11 @@ function video_dl($VIDEO, $CACHEDIR, $FILENAME){
function video_xt_audio($VIDEO, $CACHEDIR, $FILENAME){
+ $fp=fopen($CACHEDIR."/".$FILENAME.".audio.txt", "w");
+ $content="extracting audio: ".$FILENAME."\n";
+ fputs($fp, $content);
+ fclose($fp);
+
//exec("youtube-dl --no-part -x --output '".escapeshellarg($CACHEDIR."/".$FILENAME.".%(ext)s' " .escapeshellarg($VIDEO), $pid, $ret);
exec("youtube-dl --no-part -x --output ".escapeshellarg($CACHEDIR."/".$FILENAME.".%(ext)s")." " .escapeshellarg($VIDEO), $pid, $ret);
// echo "youtube-dl --no-part -x --output ".escapeshellarg($CACHEDIR."/".$FILENAME.".%(ext)s")." " .escapeshellarg($VIDEO); //, $pid, $ret);
diff --git a/index.php b/index.php
index e890577..9cad5db 100644
--- a/index.php
+++ b/index.php
@@ -27,7 +27,9 @@
</div>
<div class="row">
<p>Paste a link from youtube, vimeo or other <a href="/faq#supported_plattforms" title="FAQ: Supported plattforms">supported</a> video plattforms.<br>
- Stream the video, extract the audio or download it direct to the disk! <br><i>(up to <strong>50M</strong> for download or <strong>200M</strong> for streaming)</i></p>
+ Stream the video, extract the audio or download it direct to the disk! <br>
+ <?php //<br> <i>(up to <strong>50M</strong> for download or <strong>200M</strong> for streaming)</i></p> ?>
+ <i>(up to <strong>200M</strong>)</i></p>
<form method='POST' action='/video'>
<input type='text' name='vid' placeholder='https://www.youtube.com/watch?v=sTSA_sWGM44' style="color:#5b5b5b;" onclick="this.value=''">
<br><br>