mor/

yt-check

1.0 2022-07-03 16:03 UTC

This package is auto-updated.

Last update: 2024-09-30 01:29:00 UTC


README

检查YouTube视频是否存在。

设置

使用composer安装包

composer require mor/yt-check

使用方法

use YtCheck\Yt;

检查视频是否存在

$id = 'BUykFA7FCo4'; // It can be a url.

$isValid = Yt::isValid($id); // True or False

获取关于视频的一些详细信息

$url = 'https://www.youtube.com/shorts/BUykFA7FCo4'; // It can be an id.

$video = Yt::oembed($url);
$title = $video->title;

// OR

$video = new Yt($url);
$title = $video->title; // Returns title
$author_name = $video->author_name;
$author_url = $video->author_url;
$type = $video->type;
$thumbnail_url = $video->thumbnail_url;
$html = $video->html; // Iframe of video