feat!: add userdata feature for all personal data queries (playback history, subscriptions)

This commit is contained in:
ThetaDev 2025-02-07 04:43:35 +01:00
parent c87bac1856
commit 65cb4244c6
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
31 changed files with 189 additions and 143 deletions

View file

@ -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
}