Accounts
Yt::Account
represents a YouTube account.
Initialize using either their access or refresh token:
Authentication
All methods of Yt::Account
act on behalf of YouTube accounts (e.g.: upload a video, create 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:
A few methods acts on behalf of YouTube content owners (e.g.: fetch the content owner of an account).
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 content owner, and pass the content owner as the :auth
parameter:
List of Yt::Account
methods
- must authenticate as a YouTube account Account’s User Info
→ Yt docs
account.id # => "11668677593"
→ Yt docsaccount.email # => "user@example.com"
→ Yt docsaccount.has_verified_email? # => true
→ Yt docsaccount.name # => "Michael Stipe"
→ Yt docsaccount.given_name # => "Michael"
→ Yt docsaccount.family_name # => "Stipe"
→ Yt docsaccount.profile_url # => "https://plus.google.com/11668677593"
→ Yt docsaccount.avatar_url # => "https://lh3.googleusercontent.com/-XCWA/photo.jpg"
→ Yt docsaccount.gender # => "male"
→ Yt docsaccount.locale # => "en"
→ Yt docsaccount.hd # => "example.com"
- must authenticate as a YouTube account Account’s Updates
- must have content owner privileges Account’s Content Owners
- must authenticate as a YouTube account Account’s Associations
→ Yt docs
account.channel # => #<Yt::Channel …>
→ Yt docsaccount.playlists # => #<Yt::Collections::Playlists …>
→ Yt docsaccount.related_playlists # => #<Yt::Collections::RelatedPlaylists …>
→ Yt docsaccount.subscribed_channels # => #<Yt::Collections::SubscribedChannels …>
→ Yt docsaccount.videos # => #<Yt::Collections::Videos …>
→ Yt docsaccount.subscribers # => #<Yt::Collections::Subscribers …>