Aller au contenu

omnishow/youtube Référence de l’API

Étage
Fournisseur
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnishow/youtube:1.x-dev

Lue dans les fichiers PHP du paquet au commit 034ea6988021 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnishow\Youtube

  • YoutubeFactory class

    "youtube": options key (required: a YouTube Data API v3 key), language (titles and descriptions in this language where the owner translated them: videos.list's hl), api ("https://www.googleapis.com/youtube/v3/").

    3 options · 1 method

  • YoutubeProvider class

    YouTube through the YouTube Data API v3 with an API key (public data, no user signed in): videos (videos.list, 50 a call), a search (search.list), a channel by its identifier or @handle (channels.list), its uploads (its uploads playlist, read with playlistItems.list, then videos.list for the whole records), playlists (playlists.list, playlistItems.list), what a channel broadcasts live and has scheduled (search.list's eventType=live or upcoming, then videos.list's liveStreamingDetails). liveBroadcasts.list needs the owner's OAuth: not used.

    14 methods

Omnishow\Youtube

YoutubeFactory class

final class YoutubeFactory extends ProviderFactory YoutubeFactory.php:17

"youtube": options key (required: a YouTube Data API v3 key), language (titles and descriptions in this language where the owner translated them: videos.list's hl), api ("https://www.googleapis.com/youtube/v3/").

Options

OptionDefault
api'https://www.googleapis.com/youtube/v3/'
languagenull
keyrequired

YoutubeFactory::__construct()

public function __construct(readonly ?HttpClientInterface $http = null)

YoutubeProvider class

final class YoutubeProvider implements ProviderInterface, VideoInterface, VideoSearchInterface, ChannelInterface, PlaylistInterface, LiveInterface YoutubeProvider.php:42

YouTube through the YouTube Data API v3 with an API key (public data, no user signed in): videos (videos.list, 50 a call), a search (search.list), a channel by its identifier or @handle (channels.list), its uploads (its uploads playlist, read with playlistItems.list, then videos.list for the whole records), playlists (playlists.list, playlistItems.list), what a channel broadcasts live and has scheduled (search.list's eventType=live or upcoming, then videos.list's liveStreamingDetails). liveBroadcasts.list needs the owner's OAuth: not used.

Quota: each call costs a unit of the project's 10,000 a day, a search one of its "Search Queries" bucket (100 a day by default); live() and schedule() make one search each.

YoutubeProvider::__construct()

public function __construct(readonly JsonClient $json, readonly string $key, readonly string $api = 'https://www.googleapis.com/youtube/v3/', readonly ?string $language = null)

YoutubeProvider::getName()

public function getName(): string

YoutubeProvider::getTitle()

public function getTitle(): string

YoutubeProvider::capabilities()

public function capabilities(): Capabilities

YoutubeProvider::video()

public function video(VideoRef $ref): ?Video

YoutubeProvider::videos()

public function videos(array $refs): array

YoutubeProvider::searchVideos()

public function searchVideos(VideoQuery $query): Page

YoutubeProvider::channel()

public function channel(string $channel): ?Channel

YoutubeProvider::channelVideos()

public function channelVideos(string $channel, ?string $page = null, int $limit = 25): Page

YoutubeProvider::playlist()

public function playlist(string $id): ?Playlist

YoutubeProvider::playlists()

public function playlists(string $channel, ?string $page = null, int $limit = 25): Page

YoutubeProvider::playlistVideos()

public function playlistVideos(string $id, ?string $page = null, int $limit = 25): Page

YoutubeProvider::live()

public function live(string $channel): ?Stream

YoutubeProvider::schedule()

public function schedule(string $channel, int $limit = 10): array