Remove unused code

Unit tests for every function
Error handling
This commit is contained in:
Pierre Rudloff 2015-09-04 22:45:55 +02:00
parent de96f30d57
commit 11ff0fa9c4
7 changed files with 159 additions and 138 deletions

View file

@ -14,10 +14,11 @@
require_once 'common.php';
require_once 'download.php';
if (isset($_GET["url"])) {
$video = VideoDownload::getURL($_GET["url"]);
if (isset($video['url'])) {
try {
$video = VideoDownload::getURL($_GET["url"]);
header('Location: '.$video['url']);
} else {
echo "Can't find video";
} catch (Exception $e) {
header('Content-Type: text/plain');
echo $e->getMessage();
}
}