Remove unused code
Unit tests for every function Error handling
This commit is contained in:
parent
de96f30d57
commit
11ff0fa9c4
7 changed files with 159 additions and 138 deletions
8
json.php
8
json.php
|
@ -15,6 +15,10 @@ require_once 'common.php';
|
|||
require_once 'download.php';
|
||||
if (isset($_GET["url"])) {
|
||||
header('Content-Type: application/json');
|
||||
$video = VideoDownload::getJSON($_GET["url"]);
|
||||
echo json_encode($video);
|
||||
try {
|
||||
$video = VideoDownload::getJSON($_GET["url"]);
|
||||
echo json_encode($video);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(array('success'=>false, 'error'=>$e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue