PHPackages                             ayacoo/video-validator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ayacoo/video-validator

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

ayacoo/video-validator
======================

Checks online videos in TYPO3 for availability

4.1.3(4mo ago)111.2k↓25%2[1 issues](https://github.com/ayacoo/video-validator/issues)GPL-2.0-or-laterPHPPHP &gt;=8.2 &lt; 8.6CI passing

Since Jan 2Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ayacoo/video-validator)[ Packagist](https://packagist.org/packages/ayacoo/video-validator)[ Docs](https://www.ayacoo.de)[ RSS](/packages/ayacoo-video-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (19)Used By (0)

TYPO3 Extension video\_validator
================================

[](#typo3-extension-video_validator)

1 Features
----------

[](#1-features)

- Checks if your YouTube or Vimeo videos are still available in the TYPO3 project
- Can send you reports by email
- Can use a custom report service
- Can also check more media extensions through flexible extensibility

2 Usage
-------

[](#2-usage)

### 2.1 Installation

[](#21-installation)

#### Installation using Composer

[](#installation-using-composer)

The recommended way to install the extension is using Composer.

Run the following command within your [Composer](https://getcomposer.org/) based TYPO3 project:

```
composer require ayacoo/video-validator

```

Do not forget to activate the extension in the extension manager and to update the database once, so that the two new fields are added.

### 2.2 Setting up tasks / How do the tasks work together? (TYPO3 Integrator stuff)

[](#22-setting-up-tasks--how-do-the-tasks-work-together-typo3-integrator-stuff)

The tasks can be set up via CLI (see Developer Corner) or directly in the scheduler.

In the scheduler we create a new task `Execute console commands`. The schedulable command `videoValidator:validate` should be set up first. This command regularly checks YouTube and Vimeo videos and stores information about the status and crawl time in the data set.

TODO Screenshot

Afterwards, we create a task 'videoValidator:report' in the same scheme. Note the settings here and define at least one recipient.

TODO Screenshot

3 FAQ
-----

[](#3-faq)

### 3.1 How it works

[](#31-how-it-works)

EXT:video\_validator fetches all files from the sys\_file table that are linked to this media extension, e.g. YouTube. Thereby a validation\_date is considered.

If the video list has been worked through, the videos are checked again by default after 7 days. These settings can be overwritten for the respective task.

Using the oEmbed API of the providers, you can read the status of a video without an API key. Private videos are marked as faulty, but cannot be saved in TYPO3 anyway. Note the difference between private videos and unlisted videos!

### 3.2 Supported media extensions

[](#32-supported-media-extensions)

- YouTube
- Vimeo
- Custom media extension, see developer doc

### 3.3 What do I do if a video is not accessible?

[](#33-what-do-i-do-if-a-video-is-not-accessible)

It may happen that at some point videos are no longer accessible. These are listed in the report mail as invalid videos. TYPO3 offers a number next to the file in the file list. If you click on it, all references to this file are listed. Now you can take care of the corresponding corrections.

4 Administration corner
-----------------------

[](#4-administration-corner)

### 4.1 Versions and support

[](#41-versions-and-support)

VersionTYPO3PHPSupport / Development4.x13.x8.2 - 8.5features, bugfixes, security updates3.x12.x8.1 - 8.4bugfixes, security updates2.x10.x - 11.x7.4 - 8.0bugfixes, security updatesHint: Version 1 users should update to version 2

### 4.2 Release Management

[](#42-release-management)

video\_validator uses [**semantic versioning**](https://semver.org/), which means, that

- **bugfix updates** (e.g. 1.0.0 =&gt; 1.0.1) just includes small bugfixes or security relevant stuff without breaking changes,
- **minor updates** (e.g. 1.0.0 =&gt; 1.1.0) includes new features and smaller tasks without breaking changes,
- and **major updates** (e.g. 1.0.0 =&gt; 2.0.0) breaking changes which can be refactorings, features or bugfixes.

5 Developer corner (TYPO3 Developer stuff)
------------------------------------------

[](#5-developer-corner-typo3-developer-stuff)

### 5.1 CLI calls

[](#51-cli-calls)

The calls can be retrieved directly via CLI or you can set up corresponding jobs in the scheduler. Advantage of the scheduler: The TYPO3 is displayed correctly in the mail:

It is unclear how many fast accesses in a row the oEmbed API allows as a maximum. Therefore, it is better to think small limits.

#### videoValidator:validate

[](#videovalidatorvalidate)

Validates a defined number of videos for the defined media extension

```
vendor/bin/typo3 videoValidator:validate --extension --limit --referencedOnly=0(default)|1 --referenceRoot=0(default)

```

Example:

```
vendor/bin/typo3 videoValidator:validate --extension=Vimeo --limit=10

```

Example for fetching only videos that are referenced on visible, non-deleted pages within visible, non-deleted references:

```
vendor/bin/typo3 videoValidator:validate --extension=Vimeo --limit=10 --referencedOnly=1

```

You can specify the `--referenceRoot` option to specify a PageRoot UID where to search for references. `0` by default means all available roots.

Pay attention to using the right upper/lowercase media extension names (`YouTube` instead of `YouTube`), which are defined by the name of the Validator instance.

#### videoValidator:report

[](#videovalidatorreport)

Create an email report of YouTube videos from the last 7 days

```
vendor/bin/typo3 videoValidator:report --days --recipients --extension --referencedOnly=0(default)|1 --referenceRoot=0(default)

```

Example:

```
vendor/bin/typo3 videoValidator:report --days=7 --recipients=receiver@example.com,receiver2@example.com --extension=YouTube

```

The same `referencedOnly` and `referenceRoot` options like in `videoValidator:validate` are available.

#### videoValidator:reset

[](#videovalidatorreset)

Resets all video states of a media extension.

```
vendor/bin/typo3 videoValidator:reset --extension

```

Example:

```
vendor/bin/typo3 videoValidator:reset --extension=YouTube

```

#### videoValidator:count

[](#videovalidatorcount)

Counts all videos of a media extension. This will help you to decide which limits you can work with.

```
vendor/bin/typo3 videoValidator:count --extension

```

Example:

```
vendor/bin/typo3 videoValidator:count --extension=YouTube

```

### 5.2 Register your custom validator

[](#52-register-your-custom-validator)

EXT:video\_validator is built in such a way that other media extensions can also be checked. For this, the media extension must be registered in `$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['onlineMediaHelpers']` and you must register a validator via an event.

As example you can use the [EXT:tiktok](https://github.com/ayacoo/tiktok).

### EventListener registration

[](#eventlistener-registration)

```
services:
  Ayacoo\Tiktok\Listener\ValidatorListener:
    tags:
      - name: event.listener
        identifier: 'tiktok/validator'
        method: 'setValidator'
        event: Ayacoo\VideoValidator\Event\ModifyValidatorEvent

```

### EventListener

[](#eventlistener)

```
