move website

This commit is contained in:
tykayn 2021-03-18 23:04:04 +01:00
parent 42fede81e5
commit 32cb91f07d
4 changed files with 30 additions and 4 deletions

View File

27
website/download.php Normal file
View File

@ -0,0 +1,27 @@
<?php
function command_exist($cmd) {
$return = shell_exec(sprintf("which %s", escapeshellarg($cmd)));
return !empty($return);
}
if(isset($_POST['url'])){
// sanitize input
$url = $_POST['url'];
echo "récupération de la vidéo à l'url " . $url. " ... <br>";
if (!command_exist('youtube-dl')) {
print '[Erreur] pas de commande youtube-dl installée sur ce serveur';
} else {
shell_exec('youtube-dl -i -f best --output "../input/ydl/%(title)s.%(ext)s" '.$url);
}
}else{
echo "pas d'url envoyée. Vérifiez le formulaire. <a href='index.php'>Retour</a>";
}
include( 'website/run.php' );

View File

@ -1,6 +1,5 @@
<?php <?php
include('src/download.php'); include( 'website/download.php' );
include('src/run.php');
?> ?>
<html> <html>
<head> <head>
@ -14,8 +13,8 @@
<h1>Transcription</h1> <h1>Transcription</h1>
<section> <section>
Donnez l'url de la vidéo à transcrire. Donnez l'url de la vidéo à transcrire.
<form action='' > <form action='download.php' method='post' >
<input type='text' > <input type='text' name='url'>
<button type='submit'>Envoyer</button> <button type='submit'>Envoyer</button>
</form > </form >
</section> </section>