aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crates/yt/src/update/updater.rs34
1 files changed, 19 insertions, 15 deletions
diff --git a/crates/yt/src/update/updater.rs b/crates/yt/src/update/updater.rs
index 04bcaa1..60e9855 100644
--- a/crates/yt/src/update/updater.rs
+++ b/crates/yt/src/update/updater.rs
@@ -19,7 +19,7 @@ use futures::{StreamExt, future::join_all, stream};
use log::{Level, debug, error, log_enabled};
use serde_json::json;
use tokio_util::task::LocalPoolHandle;
-use yt_dlp::{InfoJson, YoutubeDLOptions, json_cast, json_get, process_ie_result};
+use yt_dlp::{InfoJson, PythonError, YoutubeDLOptions, json_cast, json_get, process_ie_result};
use crate::{
ansi_escape_codes::{clear_whole_line, move_to_col},
@@ -160,24 +160,28 @@ impl Updater {
}
})
// Don't fail the whole update, if one of the entries fails to fetch.
- .filter_map(|base| match base {
+ .filter_map(move |base| match base {
Ok(ok) => Some(ok),
Err(err) => {
- let process_ie_result::Error::Python(err) = &err;
+ match err {
+ process_ie_result::Error::Python(PythonError(err)) => {
+ if err.contains( "Join this channel to get access to members-only content ",) {
+ // Hide this error
+ } else {
+ // Show the error, but don't fail.
+ let error = err
+ .strip_prefix("DownloadError: \u{1b}[0;31mERROR:\u{1b}[0m ")
+ .unwrap_or(&err);
+ error!("While fetching {:#?}: {error}", sub.name);
+ }
- if err.contains(
- "Join this channel to get access to members-only content ",
- ) {
- // Hide this error
- } else {
- // Show the error, but don't fail.
- let error = err
- .strip_prefix("DownloadError: \u{1b}[0;31mERROR:\u{1b}[0m ")
- .unwrap_or(err);
- error!("{error}");
+ None
+ }
+ process_ie_result::Error::InfoJsonPrepare(error) => {
+ error!("While fetching {:#?}: Failed to prepare info json: {error}", sub.name);
+ None
+ },
}
-
- None
}
}))
}