PHP code example of socialapis / youtubedownloader

1. Go to this page and download the library: Download socialapis/youtubedownloader 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/ */

    

socialapis / youtubedownloader 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();