Add cookie paste UI, treat break-on-existing as success, skip playlist metafiles
- Update cookies.txt by pasting Netscape-format contents in web UI settings and the desktop GUI settings window (shared write/validation in web.rs) - Treat yt-dlp exit code 101 (--break-on-existing reached an archived video) as a successful "up to date" outcome instead of a failed job - Add --no-write-playlist-metafiles so channel avatars/info aren't written as phantom "Title [CHANNEL_ID]" files Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
1ef3fe56c6
commit
3d317797ec
3 changed files with 149 additions and 1 deletions
38
src/app.rs
38
src/app.rs
|
|
@ -101,6 +101,8 @@ pub struct App {
|
|||
settings_bind_mode: String,
|
||||
settings_password_enabled: bool,
|
||||
settings_password_input: String,
|
||||
settings_cookies_input: String,
|
||||
settings_cookies_status: String,
|
||||
// Maintenance (library health) window
|
||||
show_maintenance: bool,
|
||||
health_report: Option<crate::maintenance::HealthReport>,
|
||||
|
|
@ -193,6 +195,8 @@ impl App {
|
|||
settings_bind_mode: crate::web::bind_mode_of(&config_bind).to_string(),
|
||||
settings_password_enabled: password_set,
|
||||
settings_password_input: String::new(),
|
||||
settings_cookies_input: String::new(),
|
||||
settings_cookies_status: String::new(),
|
||||
show_maintenance: false,
|
||||
health_report: None,
|
||||
}
|
||||
|
|
@ -574,6 +578,13 @@ impl App {
|
|||
self.settings_password_enabled =
|
||||
self.config.web.download_password.is_some();
|
||||
self.settings_password_input.clear();
|
||||
self.settings_cookies_input.clear();
|
||||
let (exists, n) = crate::web::cookies_status();
|
||||
self.settings_cookies_status = if exists {
|
||||
format!("{n} cookie(s) loaded")
|
||||
} else {
|
||||
"no cookies.txt".to_string()
|
||||
};
|
||||
}
|
||||
}
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
|
|
@ -1079,6 +1090,33 @@ impl App {
|
|||
}
|
||||
});
|
||||
ui.end_row();
|
||||
|
||||
ui.label("Cookies:");
|
||||
ui.vertical(|ui| {
|
||||
ui.label(egui::RichText::new(&self.settings_cookies_status).small().weak());
|
||||
ui.add(
|
||||
egui::TextEdit::multiline(&mut self.settings_cookies_input)
|
||||
.desired_rows(3)
|
||||
.desired_width(300.0)
|
||||
.hint_text("paste Netscape cookies.txt…"),
|
||||
);
|
||||
if ui.button("Update cookies").clicked() {
|
||||
match crate::web::write_cookies(&self.settings_cookies_input) {
|
||||
Ok(n) => {
|
||||
self.settings_cookies_status = format!("{n} cookie(s) loaded");
|
||||
self.settings_cookies_input.clear();
|
||||
self.status = format!("Cookies updated ({n} entries)");
|
||||
}
|
||||
Err(e) => self.status = format!("Cookies error: {e}"),
|
||||
}
|
||||
}
|
||||
ui.label(
|
||||
egui::RichText::new("Export via a browser extension, then paste.")
|
||||
.small()
|
||||
.weak(),
|
||||
);
|
||||
});
|
||||
ui.end_row();
|
||||
});
|
||||
|
||||
ui.add_space(8.0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue