Skip to content

Commit 4f6ed85

Browse files
Edit readme, add license, change download folder
1 parent 1531f0d commit 4f6ed85

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,27 @@ With these two php files you are able to create your own Youtube to MP3 API with
1919
| max_results | No | integer | The max results of search results u want to get |
2020

2121

22-
# Requirements
22+
# Software requirements
2323

2424
* [youtube-dl](https://rg3.github.io/youtube-dl/)
2525
* [ffmpeg](https://www.ffmpeg.org/)
2626
* [libmp3lame](http://lame.sourceforge.net/)
2727

28-
* [youtube-dl-php](https://github.com/norkunas/youtube-dl-php)
29-
* [google api client](https://github.com/google/google-api-php-client)
30-
3128
# General installation
3229

3330
First we install the dependencies on the server, then website.
3431

3532
## VPS
3633

37-
* Install libmp3lame (see below)
38-
* Install ffmpeg (see below)
39-
* install youtube-dl
34+
* Install ffmpeg (+ libmp3lame - see below)
35+
* [install youtube-dl](https://rg3.github.io/youtube-dl/download.html)
4036

4137
## Website
4238

4339
* Get a google developer api key
44-
* Go to a directory to run composer into (this will be the directory where you'll access the API via browser)
45-
* Install youtube-dl-php (or just do `composer require norkunas/youtube-dl-php`)
46-
* Install the google api client (or just do `composer require google/apiclient:^2.0`)
47-
* Put the `convert.php` and `search.php` in the same directory (the files in this repo is an example. These are the files I use on my VPS.)
40+
* Go to your webserver files to run composer into
41+
* Run `composer create-project michaelbelgium/youtube-to-mp3 [directoryname]` - where `directoryname` is .. a directory where people can access the API from.
42+
* Edit defines:
4843

4944
In `search.php` you can define these variables:
5045
```PHP
@@ -54,7 +49,7 @@ define("API_KEY", "");
5449

5550
# How I installed ffmpeg (compiling/building and installing)
5651

57-
If you have ffmpeg in `yum` or `apt-get` or any kind this is probably not needed. I had to do this manually as I'm using Centos 6.x
52+
If you have ffmpeg in `yum` or `apt-get` this is **not needed**. I had to do this manually as I'm using Centos 6.x
5853

5954
## libmp3lame
6055

@@ -89,6 +84,8 @@ Aftwards ffmpeg was installed in `/usr/local/bin/ffmpeg` which then I needed to
8984
# Example output
9085

9186
## Download/convert
87+
`http://michaelbelgium.me/ytconverter/convert.php?youtubelink=https://www.youtube.com/watch?v=gUJKs1m7Y8M`
88+
9289
```JSON
9390
{
9491
"error": false,

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"norkunas/youtube-dl-php": "^1.0",
66
"google/apiclient": "^2.0"
77
},
8+
"license": "MIT",
89
"authors": [
910
{
1011
"name": "Michael V.",

convert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use YoutubeDl\YoutubeDl;
55

6-
define("DOWNLOAD_FOLDER", "/var/www/html/michael/ytconverter/download/"); //Be sure the chmod the download folder
6+
define("DOWNLOAD_FOLDER", dirname(__FILE__)."/download/"); //Be sure the chmod the download folder
77
define("DOWNLOAD_FOLDER_PUBLIC", "http://michaelbelgium.me/ytconverter/download/");
88

99
header("Content-Type: application/json");

0 commit comments

Comments
 (0)