定制 alchemyguy/youtube-laravel-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alchemyguy/youtube-laravel-api

Composer 安装命令:

composer require alchemyguy/youtube-laravel-api

包简介

Modern Laravel wrapper for the YouTube Data API v3 with OAuth, live streaming, channels, and video uploads.

README 文档

README

Tests Static analysis Latest version License

Modern Laravel wrapper for the YouTube Data API v3 with OAuth, live broadcast control, channel management, and resumable video uploads.

Documentation: https://alchemyguy.github.io/YoutubeLaravelApi/

Requirements

  • PHP 8.3 or higher
  • Laravel 11.x or 12.x

Install

composer require alchemyguy/youtube-laravel-api
php artisan vendor:publish --tag=youtube-config

Add credentials to your .env:

YOUTUBE_APP_NAME="My App"
YOUTUBE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
YOUTUBE_CLIENT_SECRET="your-client-secret"
YOUTUBE_API_KEY="your-server-api-key"
YOUTUBE_REDIRECT_URL="https://yourapp.test/oauth/youtube/callback"

Quick example

use Alchemyguy\YoutubeLaravelApi\Services\AuthenticateService;
use Alchemyguy\YoutubeLaravelApi\Services\LiveStream\LiveStreamService;
use Alchemyguy\YoutubeLaravelApi\DTOs\BroadcastData;

// 1. OAuth
$auth = app(AuthenticateService::class);
$url = $auth->getLoginUrl('creator@example.com', 'channel-id');
// ... redirect, handle callback ...
$result = $auth->authenticateWithCode($code);

// 2. Schedule a live broadcast
$live = app(LiveStreamService::class);
$broadcast = $live->broadcast($result['token'], new BroadcastData(
    title: 'My Stream',
    description: 'Live coding',
    scheduledStartTime: new DateTimeImmutable('+10 minutes'),
));

Documentation

The full guide, API reference, and examples live at alchemyguy.github.io/YoutubeLaravelApi.

Upgrading from 1.x

If you're on the previous version, see UPGRADE.md — there are several breaking changes.

Contributing

Contributions welcome — see CONTRIBUTING.md. Please run composer lint and composer test:unit before opening a PR.

Security

If you discover a security vulnerability, please email the maintainer directly rather than opening an issue.

License

The MIT License (MIT). See LICENSE for details.

Credits

统计信息

  • 总下载量: 7.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 63
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 63
  • Watchers: 2
  • Forks: 29
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固