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

Pumukit Youtube Bundle Laravel Package

teltek/pumukit-youtube-bundle

A Symfony bundle that connects Pumukit with YouTube, enabling video uploads, metadata management, publication status tracking, and synchronization between your Pumukit catalog and YouTube channels.

View on GitHub
Deep Wiki
Context7

Getting Started

Before anything else: this is a Symfony bundle, not a Laravel package. It is built for Pumukit, a Symfony-based video management platform, and depends on Pumukit's core bundles, MongoDB/Doctrine ODM, and Google's PHP client libraries. If you are working inside a Laravel app, treat this package as a reference implementation of "how to upload to YouTube from a video platform" rather than something you composer require.

Minimal steps if you are inside a Pumukit installation:

  1. composer require teltek/pumukit-youtube-bundle
  2. Register Teltek\PumukitYoutubeBundle\PumukitYoutubeBundle in app/AppKernel.php (or config/bundles.php on newer Symfony).
  3. Import routing from the bundle (@PumukitYoutubeBundle/Resources/config/routing.xml) into app/config/routing.yml.
  4. Add a pumukit_youtube (or similarly named) config block with your Google OAuth client ID, client secret, and redirect URI. Check the bundle's DependencyInjection/Configuration.php for the exact keys — READMEs on low-star bundles are frequently stale.
  5. Create a Google Cloud project, enable the YouTube Data API v3, and configure OAuth consent + credentials.

Where to look first, in order:

  • DependencyInjection/Configuration.php and Extension.php — the authoritative config schema.
  • Services/ and the Resources/config/services.yml — how upload/auth services are wired and which classes you can inject.
  • Controller/ and Command/ — the admin UI entry points and CLI tasks for uploading/syncing.
  • Resources/views/ — Twig templates you may need to override.

First use case: authenticate a single channel owner via OAuth, then upload an existing Pumukit multimedia object (video) to that channel and store the returned YouTube video ID on the object.

Implementation Patterns

Service injection over controller logic. The bundle exposes upload/auth services. Inject them (YoutubeUploadService-style classes) into your own controllers or console commands rather than calling controllers directly. This keeps upload logic testable and reusable from workers.

Console commands for batch work. YouTube uploads are slow and quota-bound; drive them from a Symfony command (or Messenger handler) triggered by cron, not a synchronous web request. The bundle's commands are a good template — mimic their structure if you need a custom uploader.

Event-driven hooks. Listen to Pumukit's multimedia-object lifecycle events (persist/update) and enqueue a YouTube upload job. This decouples "video published on the platform" from "video pushed to YouTube" and gives you a retry surface.

Config-driven multi-channel. Keep OAuth credentials in parameters/yaml, one per channel, and map a Pumukit series or tag to a channel. Hardcoding a single client is the path to pain once you need a second account.

Admin UI integration. The bundle's controllers expose upload actions for the Pumukit backend; extend or decorate those controllers/routes rather than forking the bundle, so you can still pull upstream fixes.

Laravel-side pattern (porting). If you are actually on Laravel: wrap google/apiclient in a dedicated service (YoutubeUploader), store the refresh token encrypted in your users or channels table, and dispatch a queued UploadVideoToYoutube job. The Pumukit bundle's flow — OAuth once, refresh token forever, chunked resumable upload — is the pattern to replicate, not the code to depend on.

Gotchas and Tips

Framework mismatch is the headline gotcha. Two stars, zero dependents, and a Pumukit-only dependency surface mean this is effectively an internal Teltek bundle that happened to be open-sourced. Do not plan on using it as a general-purpose YouTube integration outside a Pumukit codebase.

Documentation is thin. Assume the README is incomplete. Read DependencyInjection/Configuration.php and the services.yml files to infer the real API. Grep the bundle for getParameter( to find config keys it silently expects.

Google API quota and rate limits. The YouTube Data API has a daily quota (upload costs ~1600 units) and per-user limits. A retry storm from a Symfony command can burn your quota in minutes. Add exponential backoff, honor quotaExceeded/rateLimitExceeded errors explicitly, and never loop synchronously over hundreds of Pumukit objects.

OAuth token refresh. The bundle stores OAuth tokens; make sure you persist the refresh token and handle invalid_grant by surfacing a re-auth prompt rather than crashing the upload job. Tokens expire — plan for re-consent.

Uploads are resumable and long. Use the resumable upload endpoint; a dropped connection mid-file should resume, not restart. Verify the bundle/service you call does this — older Google client wrappers didn't.

Pumukit coupling. The bundle touches Pumukit's MongoDB document model (MultimediaObject / Series). Any Pumukit upgrade can break the bundle's document mapping. Pin versions and check compatibility matrix (symfony/symfony, pumukit/*, google/apiclient).

Debugging. Use Symfony's profiler and var_dump-free logging: check app/logs/dev.log for the bundle namespace during OAuth and upload steps. The Google client library throws typed Google_Service_Exception — catch and log the full JSON body, since the status code alone rarely explains failures.

Extension points are limited. If the bundle's upload flow doesn't fit, prefer decorating its service via services.yml (decorates: <service.id>) over forking. Forking a 2-star bundle means you own it forever with no upstream.

Symfony version drift. Older Pumukit installs use Symfony 2.x/3.x conventions (AppKernel, XML routing). If you are on Symfony 5+/6+, none of the bundle's service definitions or templates will drop in cleanly — port the logic, not the bundle.

Testing. There is almost certainly no meaningful test suite. Write your own integration test that mocks the Google client and asserts token refresh + resumable-upload behavior before trusting the bundle in production.

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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package