2017 © Pedro Peláez
 

library php-youtube-dl

A PHP script to help download your videos from Youtube

image

aladdindev/php-youtube-dl

A PHP script to help download your videos from Youtube

  • Thursday, February 8, 2018
  • by aladdindev
  • Repository
  • 1 Watchers
  • 8 Stars
  • 162 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 1 Versions
  • 67 % Grown

The README.md

php-youtube-dl

A PHP script to help you download your videos from Youtube, (*1)

, (*2)

Requirements

  • PHP >=5.3
  • PHP CURL extension is optional

PHPYoutubeDL

Example #1: Basic download

require_once 'vendor/autoload.php';

use PHPYoutubeDl\PHPYoutubeDl;

$php_youtube_dl = new PHPYoutubeDl("http://www.youtube.com/watch?v=xxxxxx");

$php_youtube_dl->startDownload();
require_once 'vendor/autoload.php';

use PHPYoutubeDl\PHPYoutubeDl;

$php_youtube_dl = new PHPYoutubeDl("http://www.youtube.com/watch?v=xxxxxx");

echo $php_youtube_dl->getDirectLink();

Example #3: With progress function

require_once 'vendor/autoload.php';

use PHPYoutubeDl\PHPYoutubeDl;

function showProgress($downloaded_size, $download_size){
    echo $downloaded_size / $download_size;
    echo PHP_EOL;
    flush();
}

$php_youtube_dl = new PHPYoutubeDl("http://www.youtube.com/watch?v=xxxxxx");
$php_youtube_dl->setProgressCallback('showProgress');
$php_youtube_dl->startDownload();

php-youtube-dl-cli

Download the PHP script., (*3)

Make sure PHP-CLI is installed and added to your PATH variable., (*4)

php php-youtube-dl-cli.php -f 28 -t myvideo http://youtube.com/watch?v=xxxxxx

Arguments

You can use the following arguments:, (*5)

Option Description
-c Prints currently used JS cipher function.
-t title Specify a custom filename. The video ID and the extension will still be appended to this argument.
-f format Specify a format to download. You can access the list of available format IDs using the -l argument.
-l Lists the available formats for the provided video.
-h Prints the help section.

The Versions

08/02 2018

dev-master

9999999-dev

A PHP script to help download your videos from Youtube

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Aladdin Dev