From 45be9552f24ddee773c29d6cb52ed65c828aa5b1 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 14 Aug 2015 11:08:53 +0200 Subject: [PATCH] initial version --- README.rst | 33 +++++++++++++++++++++++++++++++++ www/info.php | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 README.rst create mode 100644 www/info.php diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..811bbe8 --- /dev/null +++ b/README.rst @@ -0,0 +1,33 @@ +***************** +youtube-dl server +***************** + +Uses `youtube-dl`__ to fetch information about videos that +can be used to download the video. + + +Usage +===== +Use ``get.php`` with the ``url`` parameter:: + + http://example.org/get.php?url=http://youtu... + +It will return JSON data about the video. +Same format as ``youtube-dl --dump-json`` returns. + + +Dependencies +============ +* PHP + + +License +======= +AGPLv3 or later. + + +Alternatives +============ +* youtube-dl-api-server__ + +__ https://github.com/jaimeMF/youtube-dl-api-server diff --git a/www/info.php b/www/info.php new file mode 100644 index 0000000..deefbf5 --- /dev/null +++ b/www/info.php @@ -0,0 +1,40 @@ + 0) { + header('HTTP/1.0 500 Internal Server Error'); + header('Content-Type: text/plain'); + echo "Error fetching video data\n"; + exit(1); +} + +header('HTTP/1.0 200 OK'); +header('Content-Type: application/json'); +echo implode("\n", $output) . "\n"; +?> -- 2.30.2