pub enum Error {
Show 21 variants
Http(String),
Url(String),
Json(String),
Xml(String),
Io(String),
InvalidYouTubeUrl(String),
VideoNotFound(String),
NotLiveStream,
StreamOffline {
reason: String,
scheduled_start: Option<String>,
},
Unplayable(String),
PlayerResponseError(String),
NoDashManifest,
QualityNotAvailable(String),
DownloadFailed(String),
FragmentFailed {
seq: u64,
tries: u32,
},
CookieParseFailed(String),
MissingData(String),
PoTokenRequired,
LoginRequired,
MembersOnly,
Regex(String),
}Expand description
Error types that can occur when using the library.
This enum covers all possible errors from network requests, parsing, stream availability, and download operations.
Variants§
Http(String)
HTTP request failed.
This can occur due to network issues, timeouts, or server errors.
Url(String)
URL parsing failed.
The provided URL could not be parsed as a valid URL.
Json(String)
JSON parsing failed.
The response from YouTube could not be parsed as valid JSON.
Xml(String)
XML parsing failed.
The DASH manifest could not be parsed as valid XML.
Io(String)
IO operation failed.
File reading/writing or other IO operations failed.
InvalidYouTubeUrl(String)
Invalid YouTube URL format.
The URL is not a recognized YouTube URL format. Supported formats include:
https://youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://youtube.com/@channel/live
VideoNotFound(String)
Video not found.
The video ID does not exist or is not accessible.
NotLiveStream
The video is not a live stream.
This library only supports live streams, not regular videos.
StreamOffline
Stream is currently offline.
The live stream exists but is not currently broadcasting.
Check scheduled_start for when it might go live.
Fields
Unplayable(String)
Stream is unplayable.
YouTube has blocked playback for some reason (geo-restriction, etc.).
PlayerResponseError(String)
Error in the player response from YouTube.
NoDashManifest
No DASH manifest available.
The stream doesn’t have a DASH manifest, which is required for downloading.
QualityNotAvailable(String)
Requested quality is not available.
The stream doesn’t offer the requested quality level.
DownloadFailed(String)
Download operation failed.
FragmentFailed
Fragment download failed after retries.
CookieParseFailed(String)
Cookie file parsing failed.
The cookies file is not in valid Netscape format.
MissingData(String)
Required data is missing from the response.
PoTokenRequired
PO Token is required for this stream.
Some streams require a PO token for authentication.
Use ClientBuilder::po_token to provide one.
LoginRequired
Login is required to access this stream.
Provide cookies from a logged-in session using
ClientBuilder::cookies_file.
MembersOnly
This is a members-only stream.
Access requires channel membership. Provide cookies from a logged-in account with an active membership.
Regex(String)
Regex compilation or matching error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.