kennisnet / youtubeurlnormalizer
Youtube URL Normalizer
Installs: 2 857
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- php: >=5.6.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-12-23 13:41:37 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