Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Video Platforms Parser

Video Platforms Parser Laravel Package

chojnicki/video-platforms-parser

Parse and extract video data from URLs, embeds, and HTML across YouTube, Vimeo, Dailymotion, and dozens more platforms. A simple PHP library that turns links into structured metadata like title, duration, thumbnail, and embed code.

View on GitHub
Deep Wiki
Context7

Easy to use grabber for video info, screens and more from YouTube and other platforms.

Frequently asked questions about Video Platforms Parser
How do I install chojnicki/video-platforms-parser in a Laravel app?
Install it via Composer with composer require chojnicki/video-platforms-parser. The package ships with an auto-discovered service provider, so Laravel 9 and newer register it automatically without manual wiring. Optionally publish the config file with php artisan vendor:publish to adjust platform lists and defaults. Run your test suite after bumping the constraint to confirm nothing in your URL handling changed.
Which video platforms does chojnicki/video-platforms-parser support?
It covers YouTube, Vimeo, Dailymotion, and dozens of other providers, including social platforms such as Twitter and X. The exact provider list lives in the package domain configuration, so check that list before assuming a niche platform is supported. Because the list can change between releases, diff the config when upgrading.
Does chojnicki/video-platforms-parser work with Laravel 10 and Laravel 11?
The package follows a standard Laravel package profile with an auto-discovered service provider, so it slots into Laravel 9 and newer applications running a supported PHP version. The supported Laravel and PHP matrix for a specific release is not always stated in the release notes, so confirm it from the package composer.json before scheduling an upgrade. Lumen-style bootstraps need explicit service provider registration.
How do I get a YouTube video title, duration, and thumbnail from a URL?
Pass the URL to the parser and it returns structured metadata including title, duration, thumbnail, and embed code. The package normalizes the URL and classifies the provider before extracting data. Handle null or partial results defensively, since upstream platforms occasionally fail to return complete metadata.
Do I need to publish the config file to use this package?
No, the defaults work out of the box. Publishing the config with vendor:publish is useful when you need to restrict accepted domains, add custom platforms, or change default behavior. Keep the published file under version control and review it on each upgrade, since provider lists change between releases.
How does the package handle x.com versus twitter.com URLs?
Version 1.4.2 added x.com alongside twitter.com as an accepted domain. The release notes do not state whether the parser canonicalizes one form to the other or preserves the input verbatim, so inspect the diff before relying on equality checks. If your application stores parsed URLs, normalize them yourself so two forms of the same link cannot produce duplicate records.
Can the parser extract video data from HTML and embed codes, not just plain URLs?
Yes, the package handles URLs, embed snippets, and raw HTML, which makes it useful for link previews and content moderation pipelines. Feed it the markup and it identifies the provider and pulls out the video metadata. Test with real-world snippets from each platform you care about, since embed markup varies.
Is chojnicki/video-platforms-parser safe to use in production?
It is a lightweight, dependency-free library that performs URL classification and metadata extraction, so the main production risks are upstream availability and canonicalization rather than the package itself. Do not treat a recognized social URL as a proxy for safe or verified, because that assumption belongs in your own validation layer. Cache parsed results to reduce calls and add timeouts around any server-side network resolution.
How do I write tests for code that uses this package?
Unit-test your own normalization and storage layer rather than the package internals, and add a targeted suite for social URL handling covering www, mixed-case, and mobile subdomains. Mock or fixture any network calls so tests stay deterministic. Assert that twitter.com and x.com inputs cannot produce duplicate records in your persistence layer.
What are the alternatives to chojnicki/video-platforms-parser?
Alternatives include oEmbed clients, embed libraries such as embed/embed, and platform-specific SDKs, but most cover fewer providers or require more wiring. This package stands out as a single dependency-free entry point for dozens of platforms plus HTML and embed parsing. If you only need YouTube, the official API or a small dedicated package may be simpler.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager