public function __construct($post, $audio_only, $outfilename = False, $vformat = False) { $this->config = (require dirname(__DIR__) . '/config/config.php'); $fh = new FileHandler(); $this->download_path = $fh->get_downloads_folder(); if ($this->config["log"]) { $this->log_path = $fh->get_logs_folder(); } $this->audio_only = $audio_only; $this->urls = explode(",", $post); if (!$this->check_requirements($audio_only)) { return; } if ($outfilename) { $this->outfilename = $outfilename; } if ($vformat) { $this->vformat = $vformat; } foreach ($this->urls as $url) { if (!$this->is_valid_url($url)) { $this->errors[] = "\"" . $url . "\" is not a valid url !"; } } if (isset($this->errors) && count($this->errors) > 0) { $_SESSION['errors'] = $this->errors; return; } if ($this->config["max_dl"] == 0) { $this->do_download(); } elseif ($this->config["max_dl"] > 0) { if ($this->background_jobs() >= 0 && $this->background_jobs() < $this->config["max_dl"]) { $this->do_download(); } else { $this->errors[] = "Simultaneous downloads limit reached !"; } } if (isset($this->errors) && count($this->errors) > 0) { $_SESSION['errors'] = $this->errors; return; } }
</div> </div> </form> <br> <div class="row"> <div class="col-lg-6"> <div class="panel panel-info"> <div class="panel-heading"><h3 class="panel-title">Info</h3></div> <div class="panel-body"> <p>Free space : <?php echo $file->free_space(); ?> </b></p> <p>Download folder : <?php echo $file->get_downloads_folder(); ?> </p> </div> </div> </div> <div class="col-lg-6"> <div class="panel panel-info"> <div class="panel-heading"><h3 class="panel-title">Help</h3></div> <div class="panel-body"> <p><b>How does it work ?</b></p> <p>Simply paste your video link in the field and click "Download"</p> <p><b>With which sites does it work?</b></p> <p><a href="http://rg3.github.io/youtube-dl/supportedsites.html">Here's</a> a list of the supported sites</p> <p><b>How can I download the video on my computer?</b></p> <p>Go to <a href="./list.php">List of files</a> -> choose one -> right click on the link -> "Save target as ..." </p>
:</h2> <table class="table table-striped table-hover "> <thead> <tr> <th style="min-width:800px; height:35px">Title</th> <th style="min-width:80px">Size</th> <th style="min-width:110px">Delete link</th> </tr> </thead> <tbody> <?php $i = 0; $totalSize = 0; foreach ($files as $f) { echo "<tr>"; echo "<td><a href=\"" . $file->get_downloads_folder() . '/' . $f["name"] . "\" download>" . $f["name"] . "</a></td>"; echo "<td>" . $f["size"] . "</td>"; echo "<td><a href=\"./list.php?delete={$i}&type={$t}\" class=\"btn btn-danger btn-sm\">Delete</a></td>"; echo "</tr>"; $i++; } ?> </tbody> </table> <br/> <br/> <?php } else { if (isset($t) && ($t === 'v' || $t === 'm')) { echo "<br><div class=\"alert alert-warning\" role=\"alert\">No {$type} !</div>"; } else {