So far I've only been messing around with javascript so, I have no idea how php works. I assume I've made some newbie mistake somewhere above which I can't fine.
Thank for the help!
<?php
require('youtube-dl.class.php');
if(!isset($_POST['submit'])) {
$url = $_POST['url'];
try {
new yt_downloader($url, TRUE, 'audio');
}
catch (Exception $e) {
die($e->getMessage());
}
}
?>
The downloader incase that's important: https://github.com/eyecatchup/php-yt_downloader/