PHP code example of pazakharov / yii2-youtube-captions-scraper

1. Go to this page and download the library: Download pazakharov/yii2-youtube-captions-scraper 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/ */

    

pazakharov / yii2-youtube-captions-scraper example snippets


use Zakharov\YoutubeScraper;

        $scraper = Yii::createObject([
            'class' => YoutubeScraper::class,
        ]);
        $captionUrl = $scraper->getCaptionsBaseUrl('https://www.youtube.com/watch?v=wNzql5TZ-i');
        $subtitles = $scraper->getSubtitles($captionUrl);