docs: update README
This commit is contained in:
parent
dee8a99e7a
commit
0432477451
15 changed files with 184 additions and 47 deletions
|
|
@ -225,7 +225,7 @@ struct OauthCodeRequest {
|
|||
/// The login process works as follows:
|
||||
/// 1. Obtain a user code and show it to the user
|
||||
/// 2. The user opens the login page under <https://google.com/device>, enters the code and logs in with his account
|
||||
/// 3. The application has to check periodically if the login has succeeded using [`RustyPipe::oauth_login`] or [`RustyPipe::oauth_wait_for_login`]
|
||||
/// 3. The application has to check periodically if the login has succeeded using [`RustyPipe::user_auth_login`] or [`RustyPipe::user_auth_wait_for_login`]
|
||||
/// 4. If the login is successful, the application receives a valid access/refresh token pair which can be used to access YouTube
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct OauthDeviceCode {
|
||||
|
|
@ -1261,7 +1261,7 @@ impl RustyPipe {
|
|||
///
|
||||
/// Returns `false` if the user has not logged in yet, in this case repeat
|
||||
/// the login attempt after a few seconds.
|
||||
/// The function [`RustyPipe::oauth_wait_for_login`] does this automatically.
|
||||
/// The function [`RustyPipe::user_auth_wait_for_login`] does this automatically.
|
||||
pub async fn user_auth_login(&self, code: &OauthDeviceCode) -> Result<bool, Error> {
|
||||
tracing::debug!("OAuth login attempt (user_code: {})", code.user_code);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ struct QRadio<'a> {
|
|||
}
|
||||
|
||||
impl RustyPipeQuery {
|
||||
/// Get the metadata of a YouTube music track
|
||||
/// Get the metadata of a YouTube Music track
|
||||
#[tracing::instrument(skip(self), level = "error")]
|
||||
pub async fn music_details<S: AsRef<str> + Debug>(
|
||||
&self,
|
||||
|
|
@ -61,7 +61,7 @@ impl RustyPipeQuery {
|
|||
.await
|
||||
}
|
||||
|
||||
/// Get the lyrics of a YouTube music track
|
||||
/// Get the lyrics of a YouTube Music track
|
||||
///
|
||||
/// The `lyrics_id` has to be obtained using [`RustyPipeQuery::music_details`].
|
||||
#[tracing::instrument(skip(self), level = "error")]
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ impl RustyPipeQuery {
|
|||
.await
|
||||
}
|
||||
|
||||
/// Search YouTube music and return items of all types
|
||||
/// Search YouTube Music and return items of all types
|
||||
pub async fn music_search_main<S: AsRef<str>>(
|
||||
&self,
|
||||
query: S,
|
||||
|
|
|
|||
|
|
@ -81,9 +81,6 @@ impl RustyPipeQuery {
|
|||
///
|
||||
/// The clients are used in the given order. If a client cannot fetch the requested video,
|
||||
/// an attempt is made with the next one.
|
||||
///
|
||||
/// If an age-restricted video is detected, it will automatically use the [`ClientType::TvHtml5Embed`]
|
||||
/// since it is the only one that can circumvent age restrictions.
|
||||
pub async fn player_from_clients<S: AsRef<str> + Debug>(
|
||||
&self,
|
||||
video_id: S,
|
||||
|
|
|
|||
Reference in a new issue