corbpie/yt-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

corbpie/yt-api

Composer 安装命令:

composer require corbpie/yt-api

包简介

A PHP YouTube API wrapper

README 文档

README

Just a PHP YouTube API wrapper for searching videos and getting channel/video/playlist data and information.

Usage

composer require corbpie/yt-api

Put your YouTube API key at line 9 of src/YTAPI.php

Use the class with:

require_once('vendor/autoload.php');

use Corbpie\YouTubeApiClass\YTAPI;

$yt = new YTAPI();

Searching videos

Search a channel

This will gets 25 videos from the NBA channel with the query "Jordan" sorted by view count

$yt->setChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getVideoSearch('Jordan', 'viewCount', 25);

Search everywhere

Just dont set channelId to search all of YouTube (Not a channel specific)

$yt->getVideoSearch('Jordan', 'viewCount', 25);

Get latest videos from a channel

Get 25 videos sorted by date published (recent -> oldest)

$yt->setChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getVideoSearch('', 'date', 25);

Order types:

  • date
  • rating
  • relevance
  • title
  • videoCount
  • viewCount

results amount is capped at max 50.

Video information

$yt->setVideoId('1fjhIWJSxfw');
$yt->getVideoData();

Channel information

$yt->setChannelId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getChannelData();

Get channel playlists (Requires channelId to have been set):

$call->getChannelPlaylistsData(50);

Playlist videos

$yt->setPlaylistId('UCWJ2lWNubArHWmf3FIHbfcQ');
$yt->getPlaylistsData();

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固