Playlist Items
Yt::PlaylistItem
represents a playlist item.
Initialize using an ID or using Yt::Playlist#playlist_items
:
Some methods from other classes also return a Yt::PlaylistItem
object
(e.g.: Yt::Playlist#add_video
) or a collection of Yt::PlaylistItem
objects (e.g.: Playlist#playlist_items
).
Authentication
Most methods of Yt::PlaylistItem
retrieve public data from YouTube (e.g.: the position in the playlist).
To use these methods (marked with below), you only need to get a Server API key from Google and configure:
Other methods acts on behalf of YouTube accounts (e.g.: delete an item from a playlist).
To use these methods (marked with below), you need to get an API Client ID/Secret from Google, obtain an access or refresh token from the account you want to act as, and pass the account as the :auth
parameter:
List of Yt::PlaylistItem
methods
- any authentication works Playlist Item’s Snippet
→ Yt docs
item.id # => "PLjW_GNR5Ir0GWEP_ove"
→ Yt docsitem.title # => "Welcome to Fullscreen"
→ Yt docsitem.description # => "We are Fullscreen"
→ Yt docsitem.published_at # => 2013-08-14 19:14:21 UTC
→ Yt docsitem.thumbnail_url # => "https://i.ytimg.com/vi/JhRmvEP4IJ8/default.jpg"
→ Yt docsitem.channel_id # => "UCxO1tY8h1AhOz0T4ENwmpow"
→ Yt docsitem.channel_title # => "Fullscreen"
→ Yt docsitem.playlist_id # => "PLSWYkYzOrPMRUYaLE6C9"
→ Yt docsitem.video_id # => "BPNYv0vd78A"
→ Yt docsitem.position # => 3
- any authentication works Playlist Item’s Privacy Status
- must authenticate as the playlist item’s account or content owner Playlist Item’s Updates
- any authentication works Playlist Item’s Associations
→ Yt docs
item.video # => #<Yt::Video …>