From 1531f0d6ed22970c980f9330be2cee11aab8634d Mon Sep 17 00:00:00 2001 From: Michael V Date: Fri, 20 Jul 2018 19:36:45 +0200 Subject: [PATCH] Make this a composer package --- composer.json | 14 ++++++++++++++ convert.php | 4 ++-- download/README.md | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 composer.json create mode 100644 download/README.md diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..b83aa32 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "michaelbelgium/youtube-to-mp3", + "description": "Convert and search youtube video's via your own API", + "require": { + "norkunas/youtube-dl-php": "^1.0", + "google/apiclient": "^2.0" + }, + "authors": [ + { + "name": "Michael V.", + "email": "michael@michaelbelgium.me" + } + ] +} diff --git a/convert.php b/convert.php index eae8468..5e8a734 100644 --- a/convert.php +++ b/convert.php @@ -30,7 +30,7 @@ 'audio-format' => 'mp3', 'audio-quality' => 0, 'output' => '%(id)s.%(ext)s', - 'ffmpeg-location' => '/usr/local/bin/ffmpeg' //optional + //'ffmpeg-location' => '/usr/local/bin/ffmpeg' ]; } $dl = new YoutubeDl($options); @@ -48,7 +48,7 @@ echo json_encode(array("error" => false, "title" => $video->getTitle(), "duration" => $video->getDuration(), "file" => $file)); } - catch (Exception $e) + catch (Exception $e) { echo json_encode(array("error" => true, "message" => $e->getMessage())); } diff --git a/download/README.md b/download/README.md new file mode 100644 index 0000000..5d928b0 --- /dev/null +++ b/download/README.md @@ -0,0 +1 @@ +In this folder the downloadable mp3's will be placed. Make sure that this folder is writable. \ No newline at end of file