aludvigsson/youtube-caption-fetcher
Composer 安装命令:
composer require aludvigsson/youtube-caption-fetcher
包简介
A PHP package to fetch captions from YouTube videos
README 文档
README
A PHP package to fetch captions from YouTube videos.
Installation
You can install the package via composer:
composer require aludvigsson/youtube-caption-fetcher
Usage
use Aludvigsson\YouTubeCaptionFetcher\YouTubeCaptionFetcher; use Aludvigsson\YouTubeCaptionFetcher\CaptionFetcherException; use Aludvigsson\YouTubeCaptionFetcher\InvalidUrlException; $fetcher = new YouTubeCaptionFetcher(); try { $transcript = $fetcher->getTranscript('https://www.youtube.com/watch?v=VIDEO_ID'); $title = $fetcher->getVideoTitle('https://www.youtube.com/watch?v=VIDEO_ID'); echo $title; print_r($transcript); } catch (CaptionFetcherException $e) { echo "An error occurred: " . $e->getMessage(); }
统计信息
- 总下载量: 104
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-17