kennisnet/youtubeurlnormalizer

Youtube URL Normalizer

Installs: 3 019

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

pkg:composer/kennisnet/youtubeurlnormalizer

0.1.0 2022-06-20 12:20 UTC

README

PHP library for normalizing Youtube urls.

Usage

The library can handle all types of urls, and either verifies it is not a Youtube url, or provides normalized variants. Two types of normalized urls are provided, one with provided valid arguments, and one without.

Just call the library with a URL you'd like to check or normalize.

<?php
$yt = new YoutubeUrlNormalizer("http://www.youtube.com/watch?v=7cZFk68S3js&time_continue=12&list=PLi_srCikhtghrNa6Ti1d4aSyPQzQ3JI63&index=4");

var_dump($yt->isYoutube);
# bool(true)

echo $yt->normalized;
# https://youtu.be/7cZFk68S3js

echo $yt->normalized_parameters;
# https://youtu.be/7cZFk68S3js?index=4&list=PLi_srCikhtghrNa6Ti1d4aSyPQzQ3JI63&time_continue=12