[][src]Struct youtube_api::YoutubeApi

pub struct YoutubeApi { /* fields omitted */ }

Implementations

impl YoutubeApi[src]

pub fn new_with_oauth<S: Into<String>>(
    api_key: S,
    client_id: String,
    client_secret: String,
    redirect_uri: Option<&str>
) -> Result<Self, Error>
[src]

pub async fn login<'_, H>(&'_ self, handler: H) -> Result<(), Error> where
    H: Fn(String) -> String
[src]

Perform an OAuth Login

Available handlers:

Example

use youtube::{YoutubeApi, auth::stdio_login};

#[tokio::main]
async fn main() {
  let api = YoutubeApi::new_with_oauth("", String::new(), String::new(), None).unwrap();

  api.login(stdio_login).await.unwrap();
}

pub fn get_oauth_url(&self) -> Result<(String, String), Error>[src]

pub async fn request_token<'_>(
    &'_ mut self,
    code: String,
    verifier: String
) -> Result<(), Error>
[src]

pub fn has_token(&self) -> bool[src]

pub async fn store_token<'_>(&'_ self) -> Result<(), Error>[src]

Stores the auth and refresh token in a .google-auth.json file for login without user input.

pub async fn load_token<'_>(&'_ self) -> Result<(), Error>[src]

Stores the auth and refresh token from a .google-auth.json file for login without user input.

impl YoutubeApi[src]

pub async fn get_video_info<'_>(id: &'_ str) -> Result<VideoMetadata, Error>[src]

pub fn new<S: Into<String>>(api_key: S) -> Self[src]

pub async fn search<'_>(
    &'_ self,
    search_request: SearchRequestBuilder
) -> Result<SearchResponse, Error>
[src]

pub async fn list_playlists<'_>(
    &'_ self,
    request: ListPlaylistsRequestBuilder
) -> Result<ListPlaylistsResponse, Error>
[src]

pub async fn list_playlist_items<'_>(
    &'_ self,
    request: ListPlaylistItemsRequestBuilder
) -> Result<ListPlaylistItemsResponse, Error>
[src]

Trait Implementations

impl Clone for YoutubeApi[src]

impl Debug for YoutubeApi[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.