You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
625 B

2 years ago
function command_exist($cmd) {
$return = shell_exec(sprintf("which %s", escapeshellarg($cmd)));
return !empty($return);
// 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);
echo "pas d'url envoyée. Vérifiez le formulaire. <a href='index.php'>Retour</a>";
include( 'website/run.php' );