feat!: add userdata feature for all personal data queries (playback history, subscriptions)
This commit is contained in:
parent
c87bac1856
commit
65cb4244c6
31 changed files with 189 additions and 143 deletions
|
|
@ -21,7 +21,7 @@ use regex::Regex;
|
|||
use url::Url;
|
||||
|
||||
use crate::{
|
||||
error::{AuthError, Error, ExtractionError},
|
||||
error::Error,
|
||||
param::{Country, Language, COUNTRIES},
|
||||
serializer::text::TextComponent,
|
||||
};
|
||||
|
|
@ -581,9 +581,10 @@ where
|
|||
///
|
||||
/// If no user is logged in, YouTube returns a "NotFound" error. This has to be corrected
|
||||
/// into a NoLogin error.
|
||||
#[cfg(feature = "userdata")]
|
||||
pub fn map_internal_playlist_err(e: Error) -> Error {
|
||||
if let Error::Extraction(ExtractionError::NotFound { .. }) = e {
|
||||
Error::Auth(AuthError::NoLogin)
|
||||
if let Error::Extraction(crate::error::ExtractionError::NotFound { .. }) = e {
|
||||
Error::Auth(crate::error::AuthError::NoLogin)
|
||||
} else {
|
||||
e
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,6 +347,7 @@ pub fn parse_textual_date_to_dt(
|
|||
/// Parse a textual date (e.g. "29 minutes ago" "Jul 2, 2014") into a Date object.
|
||||
///
|
||||
/// Returns None if the date could not be parsed.
|
||||
#[cfg(feature = "userdata")]
|
||||
pub fn parse_textual_date_to_d(
|
||||
lang: Language,
|
||||
utc_offset: UtcOffset,
|
||||
|
|
|
|||
Reference in a new issue