PHP code example of vdkar / youtube-downloader
1. Go to this page and download the library: Download vdkar/youtube-downloader library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vdkar / youtube-downloader example snippets
$yt = new \YoutubeDownloader\YoutubeDownloader();
$registrationResponse = $yt->registerDevice();
//or
$yt->registerIdKey("id", "key");
$playerResponse = $yt->playerRequest->fetch_player_info('video_id_comes_here');
//to se some output you can
echo $playerResponse->serializeToJsonString();