PHPackages                             pazakharov/yii2-youtube-captions-scraper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. pazakharov/yii2-youtube-captions-scraper

ActiveLibrary

pazakharov/yii2-youtube-captions-scraper
========================================

Youtube captions (subtitles) scraper

v0.0.3(2y ago)17MITHTMLPHP &gt;=7.4

Since Jan 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pazakharov/yii2-youtube-captions-scraper)[ Packagist](https://packagist.org/packages/pazakharov/yii2-youtube-captions-scraper)[ RSS](/packages/pazakharov-yii2-youtube-captions-scraper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (16)Versions (4)Used By (0)

Youtube Scraper
===============

[](#youtube-scraper)

The Youtube Scraper is a PHP package that allows you to scrape captions and subtitles from Youtube videos. It uses the Yii 2 framework and the Guzzle HTTP client to make requests to the Youtube API.

### Installation

[](#installation)

You can install the Youtube Scraper using Composer:

```
    composer require pazakharov/yii2-youtube-captions-scraper
```

### Usage

[](#usage)

To use the Youtube Scraper, you first need to create an instance of the YoutubeScraper class and set the languageCode property to the language code of the captions you want to scrape. You can then use the getCaptionsBaseUrl and getSubtitles methods to retrieve the base URL and subtitles, respectively.

Here's an example usage:

```
use Zakharov\YoutubeScraper;

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

In this example, we're scraping the captions (subtitles) for the video with the ID wNzql5TZ-i. The getCaptionsBaseUrl method returns the base URL for the captions, which we then pass to the getSubtitles method to retrieve the subtitles.

Note that the getSubtitles method returns an array of strings, where each string represents a subtitle. You can then use this array to display the subtitles in your application.

For use proxy use .env var HTTPCLIENT\_PROXY= or you can configure and provide own instance of Client to YoutubeScraper class.

### Testing and Contributing

[](#testing-and-contributing)

The Youtube Scraper includes a test suite to ensure that it works correctly. You can run the tests using the phpunit command:

```
vendor/bin/codecept run unit
```

This will run the test suite and output the results.

The Youtube Scraper follows the PSR-2 coding standards. You can check the code for compliance using the phpcs command:

```
composer check-code
```

Fix code by phpcbf

```
composer fix-code
```

License The Youtube Scraper is licensed under the MIT license. You can use it free of charge and without any restrictions.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

3

Last Release

838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1b6d75ef3c204521c61270b3bc3917a4cdea5f519019e6111311adbb7a228f9?d=identicon)[pazakharov](/maintainers/pazakharov)

---

Top Contributors

[![pazakharov](https://avatars.githubusercontent.com/u/59995645?v=4)](https://github.com/pazakharov "pazakharov (8 commits)")

###  Code Quality

TestsCodeception

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pazakharov-yii2-youtube-captions-scraper/health.svg)

```
[![Health](https://phpackages.com/badges/pazakharov-yii2-youtube-captions-scraper/health.svg)](https://phpackages.com/packages/pazakharov-yii2-youtube-captions-scraper)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/vapor-cli

The Laravel Vapor CLI

31310.7M8](/packages/laravel-vapor-cli)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
