PHP code example of ivanboring / drupal_youtube_dl
1. Go to this page and download the library: Download ivanboring/drupal_youtube_dl 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/ */
ivanboring / drupal_youtube_dl example snippets
$downloader = \Drupal::service('drupal_video_dl.downloader');
// Get back a file entity.
$file = $downloader->download('https://www.youtube.com/watch?v=NQuNEEiyxsk', 'public://myvideo.mp4', 'video');