{"id":20674655,"url":"https://github.com/ricardofiorani/php-video-url-parser","last_synced_at":"2025-05-07T04:06:46.802Z","repository":{"id":52416732,"uuid":"41599300","full_name":"ricardofiorani/php-video-url-parser","owner":"ricardofiorani","description":"A Simple and efficient PHP Video URL Parser that provides you thumbnails and embed codes for various video streaming websites ","archived":false,"fork":false,"pushed_at":"2021-04-29T20:18:12.000Z","size":137,"stargazers_count":63,"open_issues_count":7,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T04:06:41.727Z","etag":null,"topics":["dailymotion","embed","parse","php","thumbnails","video","video-embed","video-url","vimeo","youtube"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricardofiorani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-29T16:17:26.000Z","updated_at":"2025-01-06T02:35:09.000Z","dependencies_parsed_at":"2022-09-03T04:31:59.101Z","dependency_job_id":null,"html_url":"https://github.com/ricardofiorani/php-video-url-parser","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-video-url-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-video-url-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-video-url-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-video-url-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardofiorani","download_url":"https://codeload.github.com/ricardofiorani/php-video-url-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810273,"owners_count":21807759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dailymotion","embed","parse","php","thumbnails","video","video-embed","video-url","vimeo","youtube"],"created_at":"2024-11-16T21:06:36.178Z","updated_at":"2025-05-07T04:06:46.778Z","avatar_url":"https://github.com/ricardofiorani.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED !\nIf you have PHP 7.4 or newer then please use https://github.com/ricardofiorani/oembed instead.  \nThis lib will receive only small bugfixes, not new features anymore.\n\n# PHP Video URL Parser\n[![Build Status](https://api.travis-ci.org/ricardofiorani/php-video-url-parser.svg?branch=master)](http://travis-ci.org/ricardofiorani/php-video-url-parser)\n[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%205.3-8892BF.svg)](https://php.net/)\n[![License](https://poser.pugx.org/ricardofiorani/php-video-url-parser/license.png)](https://packagist.org/packages/ricardofiorani/php-video-url-parser)\n[![Total Downloads](https://poser.pugx.org/ricardofiorani/php-video-url-parser/d/total.png)](https://packagist.org/packages/ricardofiorani/php-video-url-parser)\n[![Coding Standards](https://img.shields.io/badge/cs-PSR--4-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ricardofiorani/php-video-url-parser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ricardofiorani/php-video-url-parser/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/ricardofiorani/php-video-url-parser/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ricardofiorani/php-video-url-parser/?branch=master)\n\nPHP Video URL Parser is a parser that detects a given video url and returns an object containing information like the video's embed code, title, description, thumbnail and other information that the service's API may give.\n\n## Installation\n\nInstall the latest version with\n\n```bash\n$ composer require ricardofiorani/php-video-url-parser\n```\n\n## Requirements\n\n* PHP 5.3\n* cURL (Or at least file_get_contents() enabled if you want to use it with Vimeo, otherwise it's not required)\n\n## Basic Usage\n\n```php\n\u003c?php\nuse RicardoFiorani\\Matcher\\VideoServiceMatcher;\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$vsm = new VideoServiceMatcher();\n\n//Detects which service the url belongs to and returns the service's implementation\n//of RicardoFiorani\\Adapter\\VideoAdapterInterface\n$video = $vsm-\u003eparse('https://www.youtube.com/watch?v=PkOcm_XaWrw');\n\n//Checks if service provides embeddable videos (most services does)\nif ($video-\u003eisEmbeddable()) {\n    //Will echo the embed html element with the size 200x200\n    echo $video-\u003egetEmbedCode(200, 200);\n\n    //Returns the embed html element with the size 1920x1080 and autoplay enabled\n    echo $video-\u003egetEmbedCode(1920, 1080, true);\n    \n    //Returns the embed html element with the size 1920x1080, autoplay enabled and force the URL schema to be https.\n    echo $video-\u003egetEmbedCode(1920, 1080, true, true);\n}\n\n//If you don't want to check if service provides embeddable videos you can try/catch\ntry {\n    echo $video-\u003egetEmbedUrl();\n} catch (\\RicardoFiorani\\Exception\\NotEmbeddableException $e) {\n    die(sprintf(\"The URL %s service does not provide embeddable videos.\", $video-\u003egetRawUrl()));\n}\n\n//Gets URL of the smallest thumbnail size available\necho $video-\u003egetSmallThumbnail();\n\n//Gets URL of the largest thumbnail size available\n//Note some services (such as Youtube) does not provide the largest thumbnail for some low quality videos (like the one used in this example)\necho $video-\u003egetLargestThumbnail();\n```\n\n## Registering your own service video (it's easy !)\nIf you want to register an implementation of some service your class just needs to implement the \"RicardoFiorani\\Adapter\\VideoAdapterInterface\" or extend the RicardoFiorani\\Adapter\\AbstractServiceAdapter\n\nA Fully functional example can be found [Here](https://github.com/ricardofiorani/php-video-url-parser/tree/master/documentation/RegisteringANewService.md).\n\nPS: If you've made your awesome implementation of some well known service, feel free to send a Pull Request. All contributions are welcome :)\n\n## Using your own framework's template engine\nA Fully functional example can be found [Here](https://github.com/ricardofiorani/php-video-url-parser/tree/master/documentation/IntegratingYourOwnRenderer.md).\n\n\n## Currently Suported Services\n* Youtube\n* Vimeo\n* Dailymotion\n* Facebook Videos\n\n## Currently Supported PHP Versions\n* PHP 5.3\n* PHP 5.4\n* PHP 5.5\n* PHP 5.6\n* PHP 7.0\n* PHP 7.1\n* PHP 7.2\n\n\u003e Please note that lib is not passing tests on HHVM, therefore, we can't guarantee it will work properly. Please use it on your own risk.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardofiorani%2Fphp-video-url-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardofiorani%2Fphp-video-url-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardofiorani%2Fphp-video-url-parser/lists"}