2014-03-13 20:07:56 +01:00
|
|
|
<?php
|
2014-07-05 12:45:24 +02:00
|
|
|
/**
|
|
|
|
* PHP web interface for youtube-dl (http://rg3.github.com/youtube-dl/)
|
|
|
|
* JSON API
|
|
|
|
*
|
|
|
|
* PHP Version 5.3.10
|
|
|
|
*
|
|
|
|
* @category Youtube-dl
|
|
|
|
* @package Youtubedl
|
2015-01-07 10:47:46 +01:00
|
|
|
* @author Pierre Rudloff <contact@rudloff.pro>
|
2014-07-05 12:45:24 +02:00
|
|
|
* @license GNU General Public License http://www.gnu.org/licenses/gpl.html
|
|
|
|
* @link http://rudloff.pro
|
|
|
|
* */
|
2015-10-29 20:43:43 +01:00
|
|
|
use Alltube\VideoDownload;
|
2015-04-19 13:16:54 +02:00
|
|
|
require_once 'common.php';
|
2014-03-13 20:07:56 +01:00
|
|
|
if (isset($_GET["url"])) {
|
|
|
|
header('Content-Type: application/json');
|
2015-09-04 22:45:55 +02:00
|
|
|
try {
|
|
|
|
$video = VideoDownload::getJSON($_GET["url"]);
|
|
|
|
echo json_encode($video);
|
|
|
|
} catch (Exception $e) {
|
|
|
|
echo json_encode(array('success'=>false, 'error'=>$e->getMessage()));
|
|
|
|
}
|
2014-03-13 20:07:56 +01:00
|
|
|
}
|